File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes out.print ln dynamic form value picking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "out.print ln dynamic form value picking" Watch "out.print ln dynamic form value picking" New topic
Author

out.print ln dynamic form value picking

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
I am generating a dynamic page inservlet using :




i am calling the parameters on client side in jsp using :




There is no null value in any variable in servlet, still i am getting value of half fields and do not getting values of other half fields.......do not know the reason why is it so?

What i do i just change <input type and field id, and same in jsp page and suddenly it picks some id....

No Field mismatch error, no null value is there in variables.

Why i am getting problem?


Regards
Azrael Noor
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Frankly, it's hard to tell what your problem is. Perhaps you could give an actual example? Show the HTML which was generated (not just some code which you say generates HTML) and show the output which you claim is incorrect (not just some code which you say generates incorrect output).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Why on earth are you generating HTML in a Servlet and processing data in a JSP. That's completely backwards!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Azrael Noor wrote:I am generating a dynamic page inservlet using :




i am calling the parameters on client side in jsp using :




There is no null value in any variable in servlet, still i am getting value of half fields and do not getting values of other half fields.......do not know the reason why is it so?

What i do i just change <input type and field id, and same in jsp page and suddenly it picks some id....

No Field mismatch error, no null value is there in variables.

Why i am getting problem?


Please use a JSP instead.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
For Saving State of Objects(Checkbox, Combo, Select, textboxes).

When i click Search and Result set is returned to Client Side, i want to save the state so that client may access what he has searched.

i do not have to used Ajax.

For that i have created a page on fly using out.println and when request go to clienst side i fetch the data which was actually searched. I just pick values from servlet using request.getparameter(out.printn's inner component ID), by using this i am able to save state of Objects.

i have 20 objects in Hand.

First I Used STATIC ARRAYS for doing so but i find it slow and this is faster technique, i am getting values but i have to do lot of rework so that JSP pick correct parameter and I Got the Problem......

When i was creating on fly pages, the ID's in the html were different from JSP's HTML.....and the on fly html should have same id's as on jsp's html and i can fetch values from it.....So Now no problem. Thanks for you views, requirement is the neccisity of mother.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Or... you could just forward to the JSP which produces the correct ID attributes, so you don't have to deal with the duplicate code which wasn't quite duplicated?
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
Or... you could just forward to the JSP which produces the correct ID attributes, so you don't have to deal with the duplicate code which wasn't quite duplicated?


How come that possible?

From JSP i have to call a servlet, where whole processing occurs(and it's not small processing)
and processing dispatches to client side.
i have to hold the values(not by ajax please), so server have to retain the value.
and again i have to transfer those values to client. with big big results.

How your idea is better then above (Out.println) method. Kindly expand.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: out.print ln dynamic form value picking