• Post Reply Bookmark Topic Watch Topic
  • New Topic

plz suggest a way...

 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm creating a database driven application using JSP/Servlets. It means there will be a lot of HTML and SQL queries. I'd like to separate programming and formatting by using servlets/Javabeans for programming and JSP for outputting and formatting. Since SQL queries are 90% of code, i'd like to find a solution that could be used by jsp authors (who are not java programmers but can use set/get properties) for retrieving multiple rows from database and display them on jsp page. At the begining I tried using javabean with collection of objects in ArrayList but its still needs some programming on JSP page (like using ArrayList).
Maybe u know some solution for that.
thx in advance
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm, have you looked at using custom JSP tags? you create you own tags that your HTML authors can use by creating classes in java and then putting them in a tag library which you use on your pages. I'm sure you can find some good tutorials on JSP custom tags out there.
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Echo Tim's comments, you can use JSTL (JSP Standard Tag Library) - specifically the SQL Tag library - there are plenty of tags in there that will do what you are looking to do.
Take a look at http://java.sun.com/products/jsp/jstl/ and http://jakarta.apache.org/taglibs/index.html for more details
The O'Reilly's book "JavaServer Pages 2nd Edition" by Hans Bergsten has several good discussions and examples on the subject. (The Third Edition (which covers JSP 2.0) is due out this month).
[ December 17, 2003: Message edited by: Mark Vender ]
 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx a lot for your replies guyz.
What about custom tags, it will take an extra time to create it, I'm looking for a standart solution.
All I need is: to have a common solution for retrieving rows from database in servlet/javabean and output it in jsp. For eg. jsp author set sql query using setProperty, and get some results using getProperty (last isnt work with multiple results).
Maybe JSTL will help me
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!