473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with String and String []

Hello, im facing a problem on String and String[]. I pass a value from another jsp , and i get the value at backend. Then i need to set this value into String[] which index 11 and pass back to jsp and show it . Anyone can give me hints or solution on that?Thanks in advanced, and hope to get your replies soon....:)
Mar 25 '08 #1
3 1350
r035198x
13,262 8TB
Hello, im facing a problem on String and String[]. I pass a value from another jsp , and i get the value at backend. Then i need to set this value into String[] which index 11 and pass back to jsp and show it . Anyone can give me hints or solution on that?Thanks in advanced, and hope to get your replies soon....:)
Which part do you need help with specifically?
You did say you can pass parameters between JSPs.
Mar 25 '08 #2
Which part do you need help with specifically?
You did say you can pass parameters between JSPs.
Ya, i can get the value(i called it stall's id) from page A to page B. Then i need to place stallId in text box which in display table.

at jsp:

Expand|Select|Wrap|Line Numbers
  1.  <display:table name="paramsArr" cellspacing="0" cellpadding="0" requestURI="" id="paramsArr" pagesize="40" class="table">
  2.             <display:column property="name" escapeXml="true" sortable="true" titleKey="downloadParameterForm.name" style="width: 25%"/>
  3.             <display:column titleKey="downloadParameterForm.value" style="width: 30%">
  4.                 <html:text  property="valueArr" size="29" maxlength="30"/>
  5.             </display:column>
  6.             <display:column titleKey="downloadParameterForm.insert" style="width: 15%; padding-left: 15px" media="html">
  7.                 <html:multibox property="insert" >
  8.                 <c:set var="index" value="${index+1}"/>
  9.             </display:column>
  10.         </display:table>
Backend :

Expand|Select|Wrap|Line Numbers
  1.  String[] paramCons = Constants.PARAM_NAMES;
  2.         List paramsArr = new ArrayList();
  3.         String[] result = new String[paramCons.length];
  4.         String[] noValue = new String[paramCons.length];
  5.  
  6.         for(int i=0; i<paramCons.length; i++){
  7.             ParameterDto paramDto = new ParameterDto();
  8.             paramDto.setName(paramCons[i]);
  9.             paramDto.setValueArr(noValue);
  10.             if(paramCons[i].equals("MERCHANT") && (parameterForm.getStallId()!=null && !parameterForm.getStallId().equals(""))){
  11.                 Stall stall = stallMgr.getStall(new Long(parameterForm.getStallId()));
  12.                 paramDto.setName("MERCHANT");
  13.                 result[i] =  stall.getStallId(); // this is stallId, eg: 1234778
  14.                 paramDto.setValueArr(result);
  15.             }
  16.             paramsArr.add(paramDto);
  17.         }
  18.  
** paramDto is a bean


I hope those codes will provide more explanation/understand to you....What i need to solve is display the stallId in the correct text box in display tag. Thank for reply.
Mar 25 '08 #3
I have make it already, anyway, thank you very much on reply!
Below is the solution, if anybody has same problem with me, can have look! :)
Backend code still remain, but change setValueArr( ) to setValue( ), which is set value as string, not string[] anymore.

But there is changes at jsp:
<c:set var="index" value ="0"/>
<c:set var="valueIndex" value="0"/>
<display:table name="paramsArr" cellspacing="0" cellpadding="0" requestURI="" id="paramsArr" pagesize="40" class="table">
<display:column property="name" escapeXml="true" sortable="true" titleKey="downloadParameterForm.name" style="width: 25%"/>
<display:column titleKey="downloadParameterForm.value" style="width: 30%" >
<html:text property="valueArr" size="29" maxlength="30" value="${paramsArr.value}" />
<c:set var="valueIndex" value="${valueIndex+1}"/>
</display:column>
<display:column titleKey="downloadParameterForm.insert" style="width: 15%; padding-left: 15px" media="html">
<html:multibox property="insert"><c:out value="${index}"/></html:multibox>
<c:set var="index" value="${index+1}"/>
</display:column>
</display:table>
Mar 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: muser | last post by:
is string converted to its integer equivalent by minusing it by 48? the function is suppose to check the fifth digit of struct member using the formula contained within the function. The function...
7
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
12
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
7
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
4
by: David Scemama | last post by:
Hi, I'm trying to read a database file written from a turbo Pascal program. I've set a structure to map the records in the file, but I have problem reading the file when I use VBFixedArray in...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
8
by: Rinaldo | last post by:
Hi, When I start my program in the debugger, there is no problem, but when not I get an exception. It appears in: private void Upload(string filename, string FTnaam) { MessageBox.Show("in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.