User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,055 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,390 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 471 | Replies: 4 | Solved
Reply
Join Date: Jul 2008
Posts: 3
Reputation: tefbaez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tefbaez tefbaez is offline Offline
Newbie Poster

sending textbox info from one page to another

  #1  
Jul 24th, 2008
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

  1. <html>
  2. <body>
  3. <form name="pagina" method="get" action="pagina2.jsp">
  4. Nombre:
  5. <input type="text" name="usuario">
  6. <input type="submit" value="submit">
  7. </form>
  8. </body>
  9. </html>

Oh, i MUST use the get method, i was told to... so if anyone can guide me id very much appreciate it!
tia.
Last edited by peter_budo : Jul 25th, 2008 at 8:02 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2007
Location: Mumbai(Bombay), India
Posts: 164
Reputation: stephen84s is on a distinguished road 
Rep Power: 2
Solved Threads: 25
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Junior Poster

Re: sending textbox info from one page to another

  #2  
Jul 25th, 2008
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.
Last edited by stephen84s : Jul 25th, 2008 at 8:44 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Reply With Quote  
Join Date: Jul 2008
Posts: 3
Reputation: tefbaez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tefbaez tefbaez is offline Offline
Newbie Poster

Re: sending textbox info from one page to another

  #3  
Jul 25th, 2008
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>
Last edited by Tekmaven : Jul 25th, 2008 at 1:08 pm. Reason: Code tags
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,222
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: sending textbox info from one page to another

  #4  
Jul 25th, 2008
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
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jul 2008
Posts: 3
Reputation: tefbaez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tefbaez tefbaez is offline Offline
Newbie Poster

Re: sending textbox info from one page to another

  #5  
Jul 25th, 2008
Thanks a lot for all your help, ill go ahead and read this tutorial now!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JSP Forum

All times are GMT -4. The time now is 12:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC