aspose file tools*
The moose likes JSP and the fly likes getting  jsp form attribute back into form field from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "getting  jsp form attribute back into form field from database" Watch "getting  jsp form attribute back into form field from database" New topic
Author

getting jsp form attribute back into form field from database

viki Bhardwaj
Ranch Hand

Joined: Nov 07, 2011
Posts: 74

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

Joined: Jan 28, 2008
Posts: 5575


maintOb or maintObj ?
viki Bhardwaj
Ranch Hand

Joined: Nov 07, 2011
Posts: 74

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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Nov 07, 2011
Posts: 74

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

Joined: Nov 07, 2011
Posts: 74

I resolved the problem...
thanks to All for support..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting jsp form attribute back into form field from database