Julie Desuza

Greenhorn
+ Follow
since Sep 06, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julie Desuza

I am currently working with Java + MYSQL and found following situation.

JSP1 lists the entire records of a table. User can use this screen for listing records or selects a record from the list and modify it. User selects a record from the list and clicks on change button on JSP1 page, which opens a new JSP2 having details the record, which user selected in JSP1. User modifies the record and when hits save button of JSP2, the data should be updated and refreshed list of records should be shown to user.

Problem: I would like to make JSP1 in very generic way so it works fine when user lists only records or refreshes the list after modification.

I have written statements that extract data from JSP2 before listing program. Here JSP1 is executed first and then JSP2 so I get an error of Null pointer exception because JSP1 has not found any data from JSP2 and it�s trying to fetch data from JSP2.

Is there any statement through which, I can check�.

If (request.getParameter(�id�) is NULL)
Then ����simply retrieve data
Else ����.. fetch data from JSP2 + Update record + retrieve data.

Comments��. I know it�s pretty difficult to explain what I mean.

Any help will be appreciated...

JULIE.
19 years ago
JSP
According to me in MVC2 architecture ��..

JSP + HTML + JSP should be View Part
Action Class + Form Bean + struts-fonfig.xml should be Controller Part
Database + Java Beans should be Model Part

Question is ���..

Model is presentation layer here. Which one is persistence tier and Business Tier in between Model and Controller.

According to me���. Model must be business tier as it encapsulates business logic and Controller must be Persistence Tier���� Kindly correct me if wrong.

Regards,
Julie
19 years ago
Just to confirm from experts. I am new in Struts environment and trying to put my head into it. I assume the following.

If I have 5 input JSP forms then �

I can have 5 separate Action Form Beans (one for each form), having only getXXX() and setXXX() without implementing any business logic.

OR

I can have only single Action Form Bean for all the 5 forms.

If my one form contains 3 different actions such as Send / Cancel / Reset then I will have three action classes (One action class per each action). Every action class will have an execute() , which will return me an object of ActionForward class.

Am I going in the direction ?

- Julie
19 years ago