Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting jsp form attribute back into form field from database

 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing with a problem that i want to access form attribute back into jsp form for update purpose but m unable to getting that where i m missing
i have set List element into maintOb.
i need your suggestion for whatever i missing here.......!

thanks...




 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

maintOb or maintObj ?
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.... Venkatasamy

when i print the element of maintObj object then it prints all element whatever maintObj contained , m doing like ....
sop(maintObj.getParticulars());
sop(maintObj.getRecommsolution()); then it shows the data on console but....why its not printing in form field over jsp form....
please reply me........waiting for your reply..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint:
List list ;
//MaintananceData maintObj ;
list=(List)request.getAttribute("maintObj") ;

is that list ? why Iterator there?
<edit>
(or) you also have attribute called maintOb in request . I am wondering you dont get exception in former case ?
</edit>
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok....but i use for loop rather than iterator for getting element from the List cList to hold into an object maintObj...yet i m facing that when i try to access <%maintObj.getParticulars()%> as a form value then it is not working....
I have a query to all of you that i am using jsp:Bean then i want to know that only by defining id of jsp:bean [id=maintObj] can i access data containing by the maintObj. or rather than this i have to use getAttribute() method for retrieving the data containing by "maintObj". because i want to show the data into jsp form field .

I have used following line of code..
List clist=sqlMap.queryForList("selectmaint",maintObj);
request.setAttribute("maintObj",maintObj);


and now i want to retrieve the element containing by string maintObj over jsp form. so please tell me that how should i do???
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I resolved the problem...
thanks to All for support..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic