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.

31 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. 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
  6. 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
  7. This comment has been removed by the author.

    ReplyDelete
  8. 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
  9. 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

  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. Thank you for sharing such great information very useful to us.
    Software Testing Training in Delhi

    ReplyDelete
  16. It’s nice and valuable information; really appreciate for the nice blog...!!
    Hi guyz click here Best SAP Training in Bangalore to get the best knowledge and details and also 100% job assistance hurry up...!!

    DO NOT MISS THE CHANCE…

    ReplyDelete
  17. Lovely blog ..! I really enjoyed reading this article. Thank you for sharing such a wonderful post
    aws Training in Bangalore
    python Training in Bangalore
    hadoop Training in Bangalore
    angular js Training in Bangalore
    bigdata analytics Training in Bangalore.SAP Training in Bangalore

    ReplyDelete
  18. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me.

    Qlik Sense Online Training

    Qlik Sense Classes Online

    Qlik Sense Training Online

    Online Qlik Sense Course

    Qlik Sense Course Online

    ReplyDelete
  19. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.

    SAP MM Online Training

    SAP MM Classes Online

    SAP MM Training Online

    Online SAP MM Course

    SAP MM Course Online

    ReplyDelete
  20. Rest room marketing techniques you pertinent query previous to building. Will probably be quick to write down remarkable write-up because of this. e wallet casino

    ReplyDelete