aspose file tools*
The moose likes Struts and the fly likes Problem to add session in a struts2 application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem to add session in a struts2 application" Watch "Problem to add session in a struts2 application" New topic
Author

Problem to add session in a struts2 application

Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
Hi,

I am not able to add session in struts 2 apllication properly. When i implement sessionaware in my action class it gives me an error that
[1] cannot find symbol [javac] symbol: class SessionAware
[2] package org.apache.struts2 does not exist [javac] import org.apache.struts2.ServletActionContext

Please please help me. I never work with sessions before this.

And do let me know is there any other way to add session in the struts2 application..

I am using struts 2.2.1.1 and weblogic server
Divya Janyavula
Greenhorn

Joined: May 24, 2011
Posts: 19
Check if you have jars required for using this interface.
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

To use Session-aware interface you need to have struts2-core-2.0.6.jardownloadhere or higher version of struts-core in your WEB-INF/lib folder


Learning some thing New Every Day
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
Yogesh Lonkar wrote:To use Session-aware interface you need to have struts2-core-2.0.6.jardownloadhere or higher version of struts-core in your WEB-INF/lib folder


Thank you for the reply........

I am already using struts2-core-2.2.1.1.jar
here is a list of jar files which i m using in my application :

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
mysql-connector-java-5.0.8-bin.jar
ognl-2.7.3.jar
ognl-3.0.jar
struts2-convention-plugin-2.2.1.1.jar
struts2-core-2.2.1.1.jar
xwork-core-2.2.1.1.jar

Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

Dipali yadav wrote:
Yogesh Lonkar wrote:To use Session-aware interface you need to have struts2-core-2.0.6.jardownloadhere or higher version of struts-core in your WEB-INF/lib folder


Thank you for the reply........

I am already using struts2-core-2.2.1.1.jar
here is a list of jar files which i m using in my application :

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
mysql-connector-java-5.0.8-bin.jar
ognl-2.7.3.jar
ognl-3.0.jar
struts2-convention-plugin-2.2.1.1.jar
struts2-core-2.2.1.1.jar
xwork-core-2.2.1.1.jar



Use only one jar out of ognl-2.7.3.jar
ognl-3.0.jar these two cause they conflict with each other then clean project and run
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22

yes.........SessionAware is working finally...

But how to put model into this session and pass it to another action?? or to the util class

Any idea??
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

some of the links for tutorials
Struts2 tutorials 1
Struts2 tutorials 2
dhaval thakor
Ranch Hand

Joined: Aug 27, 2012
Posts: 53

you can use session by this method also..for that you just have to import this ActionContext class..



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem to add session in a struts2 application