You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by javaCool <ja...@pacbell.net> on 2001/02/28 03:44:15 UTC

Simple question about Struts

Has anyone used Allaire's JRun and Struts yet?  If so, are any of you fine
people willing to share tips or tricks of what to do or not do?  Thanks in
advance.

Mike V.


JSP database operations pages example here, comment and improve it

Posted by King <ki...@onestudio.com>.
Dear all,

It's so common for web pages to access database.
Those basic database operations are : browse, update, insert, delete.
I am not keen on JSP and confused with those MVC frameworks [hard to learn
without good example].
I did it in my own way (with reference from some JSP articles).

I call my way "Bean-Handler".
I did some basic pages in that way. See attachment.
I used the sample table EMP of scott of Oracle as example.
If u are not using Oracle, there are 2 sql script to create the table in ur
own database server [I have a bit modification on the data type youself]

remark: you need to download oracle thin driver yourself and change the IP
to ur database server!

In the example, you can browse[with single column sorting], insert, update,
delete and search data.
Sorry for my poor programming! You are welcome to comment, refactor or re-do
a better example for all of us.
Those MVC frameworks, such as Struts, Webwork, are popular now.
Can any expert do a similar example with those frameworks for us?

Poor things/Function missed in my example:
1. resultset paging missed [in MySQL or PostgreSQL, there is Limit-Offset
select statement to do it, how about MSSQL/Oracle]
2. Searching are case-censitive, condition field are all "AND"
3. single column sorting only [how to sort more than one column]
4. how to handle the sorting on the searched results?
5. no exception handling, how to handle the error of database server/JDBC
and runtime error?

Pls help!
Waiting for all you smart guys!

Regards,
King