Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL+Servlet+beans

 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my question and I need help to develop Servlet,JSTL,Bean..what i am going to do is ,i am developing administrator module for Inventory Management System,in this administrator can see all users in Dropdown menu(this list is coming from database) with in a JSP, .I have written one class file for connecting database and it working properly and I stucked here.. friends please give me ideas how can i do that
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas miriyala wrote:.... I have written one class file for connecting database and it working properly and I stucked here..

Where? In JSTL?
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No saperate...these are my codes
Database1.java


and Method I have written is

and I have written servlet also comboboxServlet.java

then how can i use this to call from jsp
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas miriyala wrote:then how can i use this to call from jsp

You should set the ArrayList as a scoped attribute (say request) and forward the request to the JSP using RequestDispatcher . Then you might use JSTL to iterate through the ArrayList in the JSP to create the desired HTML.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay let me try with that and i will let you know what happen anyway thanks for the reply
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made some changes to the code ,actually i am trying to print the arraylist but nothing it is printing and I am calling my class file from Servlet and I have written loop in my class file to dsiplay content of the arraylist
Here is the files what i have writen
adminclass1.java

Servlet-code

when i ran this file it need to diplay the users from the araylist in tomcat status window...but nothing it is printing..can somebody tell me what might be the wrong
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas miriyala wrote:.. when i ran this file it need to diplay the users from the araylist in tomcat status window...

What do you mean by "tomcat status window"?
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Netbeans-6.0, I can able to see the output returned by the tomcat in output window,correct me if i am wrong
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas miriyala wrote:I am using Netbeans-6.0, I can able to see the output returned by the tomcat in output window,correct me if i am wrong

I'm not sure about the NetBeans but check the server log files inside the Tomcat, you'll find those there.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay ,can you tell me what might be the wrong in my code please
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic