Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem to add session in a struts2 application

 
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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if you have jars required for using this interface.
 
Ranch Hand
Posts: 94
Hibernate Eclipse IDE 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
Hibernate Eclipse IDE 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some of the links for tutorials
Struts2 tutorials 1
Struts2 tutorials 2
 
Ranch Hand
Posts: 53
Eclipse IDE MySQL Database Java
  • 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..



 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic