Results 1 to 2 of 2
Thread: Servlet - JSP
- 06-09-2010, 08:11 PM #1
Member
- Join Date
- May 2010
- Posts
- 11
- Rep Power
- 0
Servlet - JSP
Hi,
I have a servlet which gets parameter from a jsp page(x). it is stored in a variable in servlet as shown below. the servlet response is another jsp page(y). I should put the value of amp_num in the Jsp page (y).
How should i do it? I'm trying using session.getAttribute
SERVLET:
-------------------
HttpSession session = request.getSession(false);
String amp_number = request.getParameter("amp1").toString();
int amp_num = Integer.parseInt(amp_number);
session.setAttribute("xyz",lamp_num);
JSP Page(y):
---------------
<input type="text" name="xyz" value="<%session.getAttribute(xyz); %>" size="20">
I dont need to put in a textfield, its ok if i print it. Do I need to add any path like (@servlet) because how the jsp know from which servlet i'm calling the variable xyz. please help me.
Thanks,
- 06-10-2010, 03:37 AM #2
Similar Threads
-
how can i link html+servlet+xml to form servlet
By balachandarr in forum Java ServletReplies: 0Last Post: 04-15-2009, 04:06 PM -
Servlet to Servlet connection through URLConnection
By bsrjavaforum in forum NetworkingReplies: 0Last Post: 04-01-2009, 04:12 PM -
Servlet - apache tomcat/glassfish server shuts down on servlet usage
By StewS in forum Java ServletReplies: 1Last Post: 12-02-2008, 12:23 AM -
Is there any way to transfer the file Streams from one servlet to another servlet .
By HenaPriyadarsini in forum Java ServletReplies: 0Last Post: 08-30-2008, 11:52 AM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks