473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retain values in JSP using Struts2

SaiRockinGuy
11 New Member
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 10926
r035198x
13,262 MVP
Do other values on that page retain their values?
Feb 9 '09 #2
SaiRockinGuy
11 New Member
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 MVP
Care to show the code?
Feb 9 '09 #4
SaiRockinGuy
11 New Member
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 MVP
Is </from> supposed to be </form>?
Feb 9 '09 #6
SaiRockinGuy
11 New Member
Thanks, will check and ping
Feb 9 '09 #7
SaiRockinGuy
11 New Member
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 MVP
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
SaiRockinGuy
11 New Member
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

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

Similar topics

1
5504
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 enters disappears everytime the form is refreshed when posting it to itself. Is there anyway I can retain the values that were entered on the form?
1
2530
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
4141
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 any Registry keys or config files that I can read ? Thanks in advance Aniket
5
2051
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")+")"); This code is giving this error . javax.servlet.ServletException: Too few parameters. Expected 1.
10
23205
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 input box after the submit button is clicked Thanks in advance
3
1678
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 parent form is getting refeshed but the values are not retained..could some one tell me how to retain the values... thanks
2
8903
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 called (refreshing the page). Based on the URL, COMBO2 is set. Now my problem is when page refreshes, COMBO1 is getting the same value as before ie Option1 remains selected. I should mention at this time I am using Struts2 tag for the combo...
0
1471
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 i tried to store it as String fn="file path ......"; File file = new File(fn); fis = new FileInputStream(file); ps=conn.prepareStatement("insert into filetable(FileName) values(?)"); ps.setBinaryStream(1, fis, (int)...
0
9577
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.