File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes I need to pass Parameters from My Struts2 Action class to SessionBean for persisting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "I need to pass Parameters from My Struts2 Action class to SessionBean for persisting" Watch "I need to pass Parameters from My Struts2 Action class to SessionBean for persisting" New topic
Author

I need to pass Parameters from My Struts2 Action class to SessionBean for persisting

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi

I sincerly apolize if this is not the right forum to post this question.

Assume I have a requiremet like this need to persists Data from the Front End to DataBase .

I am using Struts2 , SessionBeans and JPA for this.


1. I have a simple Login Page with UserName and Password in a JSP .
2.I had retrivied this Username and password in my Action class .

I have a SessionBean (Remote) interface like this :



and in my SessionBean class :



Now please tell me How can i submit the UserNmae and Password the data Obtained through Getter Methods to the Bean class ??

THanks in advance :

Save India From Corruption - Anna Hazare.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

Seems simple to me, just change the method from addData() to addData(String username, String password) and then do whatever you want...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

I will do that .

But My question is how the data Obtained in the Action class through Getter Methods will be avialable to the Business Layer .

(I mean if it is a servlet i will construct a DTO inside it and pass that Object to the Business Layer )


But how in this case .

(I am new to struts and JPA ) so please apolize for silly questions .
 
 
subject: I need to pass Parameters from My Struts2 Action class to SessionBean for persisting