473,573 Members | 2,868 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 10892
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
5494
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
2510
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
4129
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
2039
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
23142
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
1670
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
8895
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...
0
1458
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);...
0
7755
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7679
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...
0
8190
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...
1
7756
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...
0
8048
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...
1
5571
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...
0
3722
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1284
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1027
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...

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.