Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Sunday, June 14, 2009

Struts2: Accessing Session Variables in JSP's

Struts 2 places named objects including the session onto the OGNL stack. Named objects can easily be retrieves using the s:property tag. For example:

<s:property value="%{#session.User.firstName}"/>


Struts 2 supports other named objects that can be accessed the same way. Suppose the attribute name attrName for all examples below.

Request parameter : #parameters['attrName ']
Request attribute : #request.attrName
Session attribute : #session.attrName
Application Attribute : #application.attrName

For more on OGNL basics, click here.

29 comments:

  1. Simple, yet very useful -- Thank You!

    ReplyDelete
  2. how to set a session object's variable using struts2?

    ReplyDelete
  3. Map session = ActionContext.getContext().getSession();

    session.put("user",userObject);

    ReplyDelete
  4. very useful thanks a lot

    ReplyDelete
  5. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete
  6. Excellent post! Thank you for Sharing. We are the best erp software providers in chennai. For more details call +91 9677025199 or email us on info@bravetechnologies.in
    erp in chennai

    ReplyDelete
  7. Thank you for Sharing. I'm working in brave technologies private limited, We are the best erp software developers based in chennai. erp providers in chennai

    ReplyDelete
  8. really you have posted an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    selenium training in chennai

    ReplyDelete
  9. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    office 2010 professional plus key deutsch

    ReplyDelete
  10. I wish to show thanks to you just for bailing me out of this particular
    trouble.As a result of checking through the net and meeting
    techniques that were not productive, I thought my life was done.


    java Training in Bangalore



    java training in chennai

    ReplyDelete
  11. It is a marvelous post. It will improve the learning. Thankful to you for sharing this wonderful post.
    Struts Training in Chennai | Struts Training | Struts Training center in Chennai | Struts course in Chennai

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. 3D Animation and Multimedia Training in Noida

    Best institute for 3d Animation and Multimedia

    Best institute for 3d Animation and Multimedia Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.

    Company Address:

    Webtrackker Technology

    C- 67, Sector- 63, Noida

    Phone: 01204330760, 8802820025

    Email: info@webtrackker.com

    Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php





    ReplyDelete
  14. Artificial intelligence Training in noida
    Artificial intelligence Training in noida-Artificial Intelligence Training in Noida, Artificial Intelligence Training classes in Noida, Artificial Intelligence Training classes in Noida, Artificial Intelligence Training

    by Real time ARTIFICIAL INTELLIGENCE Experts, Big-Data and ARTIFICIAL INTELLIGENCE Certification Training in Noida



    WEBTRACKKER TECHNOLOGY (P) LTD.
    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025
    0120-433-0760
    0120-4204716
    EMAIL: info@webtrackker.com
    Website: www.webtrackker.com



    Our Other Courses:


    artificial intelligence Training in noida

    SAS Training Institute in Delhi

    SAS Training in Delhi

    SAS Training center in Delhi

    Sap Training Institute in delhi

    Sap Training in delhi

    Best Sap Training center in delhi

    Best Software Testing Training Institute in delhi

    Software Testing Training in delhi

    Software Testing Training center in delhi

    Best Salesforce Training Institute in delhi

    Salesforce Training in delhi

    Salesforce Training center in delhi

    Best Python Training Institute in delhi



    Python Training in delhi


    Best Android Training Institute In delhi


    Best Python Training center in delhi


    Android Training In delhi


    best Android Training center In delhi

    ReplyDelete

  15. Best Solidworks training institute in noida

    SolidWorks is a solid modeling computer-aided design (CAD) and computer-aided engineering (CAE) computer program that runs on Microsoft Windows. SolidWorks is published by Dassault Systems. Solid Works: well, it is purely a product to design machines. But, of course, there are other applications, like aerospace, automobile, consumer products, etc. Much user friendly than the former one, in terms of modeling, editing designs, creating mechanisms, etc.
    Solid Works is a Middle level, Main stream software with focus on Product development & this software is aimed at Small scale & Middle level Companies whose interest is to have a reasonably priced CAD system which can support their product development needs and at the same time helps them get their product market faster.

    Company Address:
    WEBTRACKKER TECHNOLOGY (P) LTD.
    C-67,Sector-63,Noida,India.
    E-mail: info@webtracker.com
    Phone No: 0120-4330760 ,+91-880-282-0025

    webtrackker.com/solidworks-training-Course-institute-in-noida-delhi

    ReplyDelete
  16. There are numerous standards and controls that oversee this business, one of which is that individuals who give check getting the money for administrations must get an administration permit. check cashing san diego

    ReplyDelete
  17. Data science Training Institute in Noida

    Webtrackker Data science Training Institute in Noida Accelerate your career in data science by starting from basics in Statistics, Data Management and Analytics to advanced topics like Neural Networks, Machine Learning and Big Data.



    http://webtrackker.com/Best-Data-Science-Training-Institute-in-Noida.php



    Data science Training Institute in Noida

    OUR OTHER COURCES

    SAS Training center in Delhi


    Best Software Testing Training Institute in delhi

    Best Salesforce Training Institute in delhi

    Best Python Training Institute in delhi



    ReplyDelete
  18. Graphics designing training institute in Noida
    Best Graphics training institute in Noida, Graphic Designing Course, classes in Noida- webtrackker is providing the graphics training in Noida with 100% placement supports. If you are looking for the Best Graphics designing training institute in Noida For more call - 8802820025.

    Graphics designing training institute in Noida, Graphics designing training in Noida, Graphics designing course in Noida, Graphics designing training center in Noida

    Company address:
    Webtrackker Technology
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025
    Email: info@webtrackker.com
    Website: http://webtrackker.com/Best-institute-for-Graphic-Designing-training-course-in-noida.php

    ReplyDelete
  19. Webtrackker Technology is IT Company and also providing
    the Solidwork training in Noida at running project by
    the real time working trainers. If you are looking for
    the Best Solidwork training institute in Noida then you can contact
    to webtrackker technology.
    ads
    Webtrackker Technology
    C- 67, Sector- 63 (Noida)
    Phone: 0120-4330760, 8802820025

    8802820025
    Solidwork training institute in Noida

    ReplyDelete
  20. Latest News in Hindi

    Latest News in Hindi- Hindustan channel is the best online web portal in india where you read the all latest indian news in hindi. if you are looking the Latest News in Hindi, live news channel, hindi news channel, live news channels in hindi, live hindi channels then hindustan channel is best for you.
    Latest News in Hindi

    Company address:
    C- 67, Sector- 63, Noida
    Phone: 01204330760, 8802820025


    URL: https://hindustanchannel.com

    ReplyDelete
  21. These elements make the innovation not invaluable for general use, at any rate starting today. Real advocates of the innovation, nonetheless, assert that online check liquidating can be invaluable to a few, particularly to the individuals who think about time of most extreme significance.Check Cashing Carson

    ReplyDelete