Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

getting value in servlet

Posted on 2004-10-21
6
Medium Priority
?
243 Views
Last Modified: 2010-04-01
Frds,
   I have
       <td><%=Name%></td>(name is like java,C)
<td>select name="rating">
 <option value="<%=ratId%><%=ratname%></option>
</select>
This is also dynamic,
I want both value in servlet
  nameId  and ratId,
basically , how to send nameId because it is lable..
Thanks in advance...
Karan
0
Comment
Question by:Manish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12371113
Errrr....

Can you explain a bit more?

> I want both value in servlet
>  nameId  and ratId,

what is nameId?  Do you mean "Name"?  

Is this in a form?  Does the form post to a servlet?

By:

>   <option value="<%=ratId%><%=ratname%></option>

did you mean:

 <option value="<%=ratId%>"><%=ratname%></option>

?

That example JSP contains quite a few errors for such a small bit of code ;-)

Tim
0
 
LVL 11

Author Comment

by:Manish
ID: 12379152
Ok,
   I m getting values from database ..
nameId, Name
ratId and ratingName..
I m displaying these value like this
<td><%=Name%></td> and rating in combbox
<td>Rating <select name=rating>
                 <option value="<%=ratId%>"<%=ratingName%></option>
This is in form..
   My problem is how can I get nameId in serlvet
and corrouponing selected rating ..as
I m diplaying name in td ,




 
0
 
LVL 35

Accepted Solution

by:
TimYates earned 150 total points
ID: 12379186
again, that isn't valid HTML...

Do you mean like this:

<td><%=Name%></td> and rating in combbox
  <input type="hidden" name="nameId" value="<%= nameId %>">
<td>Rating <select name=rating>
                 <option value="<%=ratId%>"><%=ratingName%></option>
                  </select>
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Author Comment

by:Manish
ID: 12379236
I want to ask where to store nameId so that I cant get it in servlet...with corrousponding selected ratId
as these are dynamic ,means it is one or more..
karan
0
 
LVL 2

Assisted Solution

by:siliconeagle
siliconeagle earned 150 total points
ID: 12401977
the best place is to store it is in the session :-
<% request.getSession().setAttribute("nameId",nameId ) %>

then when you need it in the next servlet/jsp you use :-
<%=(String) request.getSession().setAttribute("nameId",nameId ) %>

this way the data is stored on the server but only available to requests from the same browser. So you dont have to store the value in the page you store it in the session and its always available for that user.
0
 
LVL 11

Author Comment

by:Manish
ID: 12432658
I stored with ratId , so I also get nameId along with
selected ratId...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question