This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes application flow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "application flow " Watch "application flow " New topic
Author

application flow

anita dhar
Ranch Hand

Joined: Jul 14, 2007
Posts: 69
Hi,

I am in confusion , if i am using develop a big application what is the flow and where i have to set all the things

like

1) user is clicking the proper url like login page

userid and password page will perform the actions
then next page will open if it is correct user and if it not correct user some other page will open

2) and if the user is correct next some form information page will open and submitting that new page will open
how this can do in struts
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Using Struts to navigate from one page to another is fairly easy. Just embed one or more <forward> stanzas in an <action> stanza of your struts-config.xml file. Then in the Action class, write code that returns one forward for one condition and another forward for another condition.

Strus navigation is one of the most basic and important concepts in Struts. I'd suggest that you spend some time doing some basic Struts tutorials to get a better understanding of it. Once you've done this, writing your own Struts application will be much easier. For a good tutorial or article, check out the links in the Struts wiki


Merrill
Consultant, Sima Solutions
anita dhar
Ranch Hand

Joined: Jul 14, 2007
Posts: 69
Sorry i am not able to find proper flow .

Suppose i am having example like this EmployeeInformation page

Employeeform ..subforms
Departmentform .. subforms
Searchformform .. subforms
Updateform .. subforms



how i will proecess these means the enteries and going from one page to another and all are different links


thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Have you worked through any basic Struts Tutorial? If you haven't I'd urge you to do so before continuing with your project. The reason I'm insisting on this is that once you have actually built and run a simple Struts project through a tutorial, it should be abundantly clear to you how the navigation works. If you haven't gone through this process, I could spend a lot of time explaining it, and it's likely you still woudldn't understand it.

If you really have done at least one Struts tutorial (meaning you've built and run a simple project following someone's instructions) and still don't understand the navigation, let us know, and we'll try and explain it in greater detail.
anita dhar
Ranch Hand

Joined: Jul 14, 2007
Posts: 69
Hello,
i have gone one struts application from the wrox but i am not able to find out the flow if there is more than applications
prasanna pati
Ranch Hand

Joined: Jan 29, 2005
Posts: 46
no not that way , do some sample application on struts , then when you will understand the dataflow then go to complex projects . OK lets do it in this way :: ( i am showing how to do a basic struts application , I assume you are quite well with JAVA , jsp , servlet xml right???)

first creat a database and a table ( in mysql or postgres ). now make a
dataaccess object java program .
like :
( some lines )
ry {
// Properties prop = new Properties() ;
//prop.load(new FileInputStream("ApplicationResource.properties"));
Class.forName("org.postgresql.Driver");
o_con = DriverManager.getConnection("jdbc ostgresql:/url mtnl","mtnl","mtnl");
o_stmt=o_con.createStatement();



now right methods for Add , edit , delete .


ok now make a DTO ( data trasfer object ) with getters / setters , you can easily make that if you are using a good IDE .

then what ?

now you are coming to struts .

make the Action form .
I will write more later . first let me know if you made the JDBC connections succesfully or not .
prasanna pati
Ranch Hand

Joined: Jan 29, 2005
Posts: 46
actuallly there are very few really good struts project for the beginners .

someone should take a initiative
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This link has a good basic Struts tutorial. Exercise 3 deals specifically with navigation. Be aware, though, that you have to complete Exercise 2 in order to do Exercise 3. Once you've done this exercise, you should have a pretty good understanding of how Struts navigation works.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: application flow