How to set a value in application scope in struts2?

satishkhowal

I have a list that is accessible to all user of my application.I am currently adding it to session of a particular user.But i want it to be in application scope rather than session scope.Please help also provide reference/link to any example

herti

I am not sure how you want to use the list: you want to display that list to the screen or you just need it as configuration. To display it you could:

  • create your list statically in your Action, then display it in the JSP
  • you could take the list dynamically from a database, then display it in the JSP

To use it as configuration: some data can be made available at application level at initialization, but those are configuration params. More info here:

Using the ServletContext is the only way you can set parameters dynamically to the servlet from your code: servletContext.setAttribute(). More info here:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to dynamically set the "value" attribute of url tag in struts2?

From Dev

How to set Struts2 dropdown list value, using an iterator variable

From Dev

how to configure scope model driven interceptor in struts2

From Java

How to prevent Maven from replacing ${id} in a Struts2 application

From Dev

How to download a zip file in a struts2 application

From Dev

How can I set the value of a $scope variable when my application starts up?

From Dev

How to set end attribute dynamically with Struts2 iterator in JSP

From Dev

how to access a struts2 property value in jsp?

From Dev

How to use ajax response list as struts2 iterator value?

From Dev

How to use ajax response list as struts2 iterator value?

From Dev

In Struts2 how to iterate a list value with if else condition

From Dev

How to retrieve session value in jsp using struts2?

From Dev

How to insert a value into Set collection in Struts 2

From Dev

How to insert a value into Set collection in Struts 2

From Dev

How to set default value for scope variable in angularjs

From Dev

How to set a default value in an AngularJS Directive Scope?

From Dev

How to set scope variable value in angularjs template

From Dev

How to set scope variable value in angularjs template

From Dev

How to navigate from one popup page to another using Jquery in struts2 application

From Dev

how to clear data in struts2 session attribute without application server restart

From Dev

How to set s:param value in Ajax success body in Struts 2

From Dev

Scope attribute migration from Struts1 to Struts2

From Dev

AngularJS / CSS - How to set the width of a select box to a value from $scope?

From Dev

How to access a property value of an object that is a Hashset when iterating in Struts2

From Dev

How to pass Id value to perform Edit operation in Struts2 with Displaytags?

From Dev

Using Struts2 Tags in Enterprise Application

From Dev

Struts2 Web application 404 error

From Dev

s:property not shown value Struts2

From Dev

Validations in Struts2 for Integer value?

Related Related

  1. 1

    how to dynamically set the "value" attribute of url tag in struts2?

  2. 2

    How to set Struts2 dropdown list value, using an iterator variable

  3. 3

    how to configure scope model driven interceptor in struts2

  4. 4

    How to prevent Maven from replacing ${id} in a Struts2 application

  5. 5

    How to download a zip file in a struts2 application

  6. 6

    How can I set the value of a $scope variable when my application starts up?

  7. 7

    How to set end attribute dynamically with Struts2 iterator in JSP

  8. 8

    how to access a struts2 property value in jsp?

  9. 9

    How to use ajax response list as struts2 iterator value?

  10. 10

    How to use ajax response list as struts2 iterator value?

  11. 11

    In Struts2 how to iterate a list value with if else condition

  12. 12

    How to retrieve session value in jsp using struts2?

  13. 13

    How to insert a value into Set collection in Struts 2

  14. 14

    How to insert a value into Set collection in Struts 2

  15. 15

    How to set default value for scope variable in angularjs

  16. 16

    How to set a default value in an AngularJS Directive Scope?

  17. 17

    How to set scope variable value in angularjs template

  18. 18

    How to set scope variable value in angularjs template

  19. 19

    How to navigate from one popup page to another using Jquery in struts2 application

  20. 20

    how to clear data in struts2 session attribute without application server restart

  21. 21

    How to set s:param value in Ajax success body in Struts 2

  22. 22

    Scope attribute migration from Struts1 to Struts2

  23. 23

    AngularJS / CSS - How to set the width of a select box to a value from $scope?

  24. 24

    How to access a property value of an object that is a Hashset when iterating in Struts2

  25. 25

    How to pass Id value to perform Edit operation in Struts2 with Displaytags?

  26. 26

    Using Struts2 Tags in Enterprise Application

  27. 27

    Struts2 Web application 404 error

  28. 28

    s:property not shown value Struts2

  29. 29

    Validations in Struts2 for Integer value?

HotTag

Archive