• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting all values in form

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a form in my jsp page.it gets user data (name ,address,age.........).
i need to send that data to other jsp page and get them to the varibles.
i used request.geaParameter() method.but i could only get the first value.why os that
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.geaParameter()


There is no such method. I realize that you meant getParameter, but this is the sort of red herring that wastes people's time. There are a bunch more spelling errors in your post. If you want people to take the time to answer your questions, please take the time to make sure that they are clear and error free.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not be submitting to a JSP, but to a servlet. On the request you will find the method getParameterMap() which will give you a Map instance of all submitted request parameters.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You should not be submitting to a JSP, but to a servlet.

Interesting. Got a cite for that? Or better, why is it bad?

I thought posting a form to a JSP was why they have the setProperty with name *



I think I've been doing this for years. Have I been lost?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why *would* you post to a JSP? Any useful form processing shouldn't happen in a JSP. JSPs are the view layer and should be doing only viewful things.The only possible usecase I could see for this is your wizard example if all validation is done on the client side (which is risky, and the data would have to be validated on the server side anyway).

It also introduces two different ways of addressing application pages: servlets and JSPs, which just seems like a recipe for trouble down the road when a URL has to change.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat Farrell wrote:
Bear Bibeault wrote:You should not be submitting to a JSP, but to a servlet.

Interesting. Got a cite for that? Or better, why is it bad?

Very old-fashioned and Model 1.

Here's my article on the subject.

And yeah, what David said.

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote: JSPs are the view layer and should be doing only viewful things.

Well, this is a bit of a value laden statement. JSPs can be just a view, but then you need something else to control dispatching. Pretty soon you are in the "too many servlets" problem, which leads to a framework.

I've just spent several months beating my head against Stripes, based on Fred's visit to the framwork section. I bought the book, wrote up all the examples, and tried to do my application. I gave up. Its too much magic.

At the time, I also downloaded, but did not implement Bear's Frontman.

Its been a couple of years since I did a lot of forms, wizards, etc. stuff with JSP/servlets, and it seems that all of my experience has fallen out of my brain. This stuff used to be easy.
 
Sri Gnana
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aruna,
Regarding this check your other post for solution. All the best.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just spent several months beating my head against Stripes

Hmm, I always found Stripes pretty straight-forward, especially considering some of the alternatives.

What about it threw you off? It's about as lightweight as they get and produces very maintainable apps.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:What about it (Stripes) threw you off? It's about as lightweight as they get and produces very maintainable apps.

I just don't get it. Too much magic. I keep getting null pointer exceptions because the key object is instantiated or not by magic or not.

I see the examples, worked them, but when I try to do things that I think are similar, it blows up and I don't see any way to debug what's wrong.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you have any questions, ask away (I guess in the frameworks forum?) -- compared to a JSP/servlet mechanism it's much, much nicer (IMO). Of course, I prefer just about anything to a JSP/servlet mechanism, although I refuse to write another Struts 1 application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!