473,386 Members | 1,720 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,386 software developers and data experts.

How to retain values in JSP using Struts2

SaiRockinGuy
Hi,
How to retain values in jsp using struts2 tags.

I am using <s:select></s:select> which has inbuilt properties in it. But the values are not retained when the page gets refreshed.Can anyone help me in this.

Thanks in advance!
Feb 6 '09 #1
10 10857
r035198x
13,262 8TB
Do other values on that page retain their values?
Feb 9 '09 #2
i dont have any text fields in that page, based on the drop down i get the list of employees and the current status of the employee.
Feb 9 '09 #3
r035198x
13,262 8TB
Care to show the code?
Feb 9 '09 #4
Expand|Select|Wrap|Line Numbers
  1. <s:form action="control.action" method="Post">
  2.     <font color="orange"><s:text name="FILTRI" /></font>
  3.     <table style="border: solid 1px #777777;">
  4.         <tr>
  5.             <th align="left" class="cdr_label"><s:text name="CDR" /></th>
  6.         </tr>
  7.         <tr>
  8.             <td align="left"><s:select name="cdrList" headerKey="-1"
  9.                 headerValue="Select"  listKey="employeeCode" listValue="description"
  10.  
  11.                 list="%{#session.EMPLOYEE_LIST}" /></td>
  12.             <td><s:submit cssClass="button_css" label="select"></s:submit></td>
  13.  
  14.         </tr>
  15.     </table>
  16.     </from>
Feb 9 '09 #5
r035198x
13,262 8TB
Is </from> supposed to be </form>?
Feb 9 '09 #6
Thanks, will check and ping
Feb 9 '09 #7
Mean while can u help me for adding other option tag in <s:select></s:select> tag.

My case is if the logged user is admin he should get the rights to view the entire drop down list or if normal user ,he can view only partial list.
Feb 9 '09 #8
r035198x
13,262 8TB
Better do that on the server side. That is where the list is coming from isn't it?
You can then return the appropriate list based on who is logged in from the server side. Your front end (JSP) doesn't need to change for that.
Feb 9 '09 #9
Ya that is the better option but for other values in the drop down i have to send the other values as the key and for this case it is not so
Feb 9 '09 #10
actually i am adding two codes in the list key and passing it through request for other values in drop down

but for the value to be displayed for admin has different key.
Feb 9 '09 #11

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

Similar topics

1
by: J P Singh | last post by:
I have simple form where user enter the search criteria and the form is posted back to itself and runs a query based on the values that are entered. Everything is expect the values that the user...
1
by: Abdul Mohsin | last post by:
is it possible to get hidden parameter values using window.opener.document.form.parameter.value. I am getting this error " Object not found" Please help Abdul
2
by: Aniket Sule | last post by:
Hi, Is there a way to read Component Services /IIS settings values using c# ? I am specifically interested in the COM Transaction timeout value and the IIS connection timeout value. Are these in...
5
by: Nirmala123 | last post by:
hai, I want to update the database table values using the getParameter(). int rs=statement.executeUpdate("update address set name='xxxx' where name=("+request.getParameter("oldname")+")"); ...
10
by: Sonasang | last post by:
Hi, I am creating a web page using ASP and Javascript. When submit button is clicked , It will search for the values in the input given(in the input box). How to retain the values in the...
3
by: arunvasuki | last post by:
Hi, I have a form with a few edit boxes. In the form i also have a search button which takes me to a small pop up window. After searching i am getting back the values in to the parent form..also the...
2
by: abehl | last post by:
Hi I have 2 combo boxes in a form. When the one combo box say COMBO1 is changed, onchange event runs with the option selected being appended to the url and the action associated with that action...
0
by: Sabzar | last post by:
Hi every buddy.. i need to store resume in mysql data base and also retrieve to display it in jsp page .what the data type should i use for database. i tried it as a blob type. and in action class...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.