Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem to add session in a struts2 application

 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if you have jars required for using this interface.
 
Yogesh Lonkar
Ranch Hand
Posts: 94
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 94
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 94
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some of the links for tutorials
Struts2 tutorials 1
Struts2 tutorials 2
 
dhaval thakor
Ranch Hand
Posts: 53
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use session by this method also..for that you just have to import this ActionContext class..



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic