954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sending textbox info from one page to another

Hey there, I need help with something... I need to create 2 .jsp pages, one with a textbox in which you submit a name, and the second one should display it when you i click the submit button...but i cant seem to get it right =S

this is what ive got on the first page

<html>
<body>
<form name="pagina" method="get" action="pagina2.jsp">
Nombre:
<input type="text" name="usuario">
<input type="submit" value="submit">
</form>
</body>
</html>


Oh, i MUST use the get method, i was told to... so if anyone can guide me id very much appreciate it!
tia.

tefbaez
Newbie Poster
3 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

That would be as simple as calling request.getParameter("--name-of-text-box--"); , in pagina2.jsp .

Also no need to stick to GET you can use POST without any issues. Only difference is GET would send your parameters as part of the HTTP URL (eg http://localhost/pagina2.jsp?usuario=tefbaez )
whereas POST would send it as part of the HTTP header, so it would not be visible in your address bar.

stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
 

well if im not doing this wrong it should work, but im obviously not doint it right cuz its not working...

this is what i have on pagina2.jsp, could you tell me what im missing?

<html>
<body>

<request.getParameter('usuario');>


</body>
</html>
tefbaez
Newbie Poster
3 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

It will never work as you directly inserted Java element into pure HTML without telling HTML you about to use something related to Java. You better start learning for example here, The Java EE 5 Tutorial

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Thanks a lot for all your help, ill go ahead and read this tutorial now!

tefbaez
Newbie Poster
3 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You