Hi,
    I work for a Bank in Taiwan. And I used MVC
pattern on my J2EE
application.
I think it is simple and clear. No extra Jar files
will be included.
Here is the concept of my idea:

The http requests contain all information that will be
used in a business
processing.
So pass it to directly to the ActionControlBean(I call
it) which control the
flow of the request.
The view is JSP, and every JSP maps to a
ActionControlBean.
The control ,ActionControlBean, is JavaBean.
The module could be JaveBean or EJB.
In this way, logic will not be mixed up with
presentation. The JSP will look
like this:

=========== View ==============
example.jsp

<%
//new a ActionControlBean and pass the request, and
this is all we have to
do in a jsp. No more code.
//start to processing the data and decide how to
response

exampleActionBean acb = new exampleActionBean();
acb.start(request,response);
%>
<!-- the result of the processing -->
the item is<%=acb.getXxx()%>

=========== Controller ============
exampleActionBean.java

public class exampleActionBean{
private String Xxx = "";//the input field of input
form

private getXxx(){return this.Xxx;}

private void start (HttpServletRequest request,
HttpServletResponse
response){
//write all you control code here
//you can decide whether just return to example.jsp or
just redirect to
another page.
//or you can use any JavaBean to supply service to
finish the process
//at the end of the method it will fill out all the
attributes belong to
this.
}

}
============= Module =============
As for the module I have nothing to say.
Just like JavaBean or EJB is used to do before.

I think in this way no business logic code will be
writen in JSP.
The controller could compose all the service-oriented
compont together.

In this way, a WebApplication will be just like an
pure Java program.
The scriptlet in JSP only helps on how to do a dynamic
presentation, such
as control the color or the location in a page. I
think the scriptlet can do
more
than JSP tag, so just make the best use of scriptlet.

If the page is trying to show data in a table, An
ArrayList would be
returned,which
contain value object of data.


Best Regards,
Chen Jen Yu.


-----------------------------------------------------------------
每天都 Yahoo!奇摩
海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
http://tw.promo.yahoo.com/mail_premium/stationery.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to