This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes a generic doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "a generic doubt" Watch "a generic doubt" New topic
Author

a generic doubt

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I do not know whether this question can be posted here but I would go ahead as my app is in struts-2...

I have a login page.After logging in...

There are 3 platforms for persistence...

1)xml
2)db
3)Serializable Object

I need to program this inputs and allow the user to decide his persistence platform...what is the best way to do it, and how to project this part in UI??

properties file?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Radiobox or dropdown?
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Yes,so how will my action classes behave or rather how should they be managed?

like, lets say I have an action class for creating a project called CreateProjectAction...

Here based on the type selected i need to create project ,For Ex if the user selects XML,the application should do xml related stuff and
I should create a Project element in an XML file in CreateProjectAction and If it's DB i should turn my application in DB mode and insert a project row in projectTable...

How to manage this way? any others inputs would be great help!!! thanks
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

You could do anything from a simple if else / switch or do something more refined like switch to different strategies of creating a project based on the selected value. You question seems to be about java in general rather than struts


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: a generic doubt
 
Similar Threads
EJB 3.0 Persistence API and Hibernate.
JPA book query
JPA book query
Persistence Context scope and type
is spring persistense with hibernate use spring 3