Need help with JSP
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 23, 2006 08:43 AM

Hi, I have problems in passing the value around in JSP. I have two JSP pages as below: test1.jsp ----------------------------------------------------------- I try to get the vaule from my textbox by using: String strUser = request.getParameter ("strUserName"); Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page). ---------------------------------------------------------- test2.jsp --------------------------------------------------- Next, i want to get the value from strUser (which mean that the one i already display on p   More>>

Hi,



I have problems in passing the value around in JSP. I have two JSP pages as below:


test1.jsp

-----------------------------------------------------------

I try to get the vaule from my textbox by using:


String strUser = request.getParameter ("strUserName");

Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).

----------------------------------------------------------



test2.jsp

---------------------------------------------------


Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using


String strUser1 = request.getParameter ("strUser");


Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.




Is it possible for me to do so?



Could you please give me some guidance?


Thanks you very much for any advise you may give me.


Kimsan

   <<Less

Re: Need help with JSP

Posted By:   Byron_Tymvios  
Posted On:   Tuesday, May 23, 2006 10:10 AM


Is your textbox on test1.jsp called strUserName? If so try replacing strUser in test2.jsp with strUserName.

Is your textbox also on test1.jsp? If so, you need to remember that JSP is a server side language and will only run once the client has submitted the page back to the server. Try getting the value from your textbox in test2.jsp by using request.getParameter("yourTextboxName"); I think this might solve your problem.


Hope this helps

Byron

About | Sitemap | Contact