• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

out.print ln dynamic form value picking

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why on earth are you generating HTML in a Servlet and processing data in a JSP. That's completely backwards!
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic