1

Using, Struts 2 + JSP

I have an index.jsp page which I'd like to display some data from database.

I would like to have my web sever automatically fetch the data from database and send the result to struts's value stack. So I can refer to them in my index.jsp page.

I am wondering how to trigger an struts action without sending a request?

I know I can use ajax to achieve this result, but I'd like to avoid making two calls to my web sever.

1
  • You shouldn't be hitting JSP pages directly anyway, instead go through an action, and kill both birds with one solar death ray. Commented Aug 20, 2014 at 18:39

1 Answer 1

1

I found the solution to use

<s:action > 

tag.

Here is an example

Struts 2 Action tags, retrieving properties

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.