top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to Use JavaScript in Struts2?

0 votes
275 views
How to Use JavaScript in Struts2?
posted Jun 4, 2014 by Naveena Garg

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+7 votes

I have an Interceptor that wants to put something in the session after the action has executed.

But if the session doesn't already exist I get an exception:

java.lang.IllegalStateException: Cannot create a session after the response has been committed

How can I determine if the session already exists from within an Interceptor?

 public String doIntercept(ActionInvocation invocation) throws Exception
 {
 String result = invocation.invoke();
 Map session = invocation.getInvocationContext().getSession();
 session.put(key, value); // throws exception if session doesn't exist
 return result;
 }
+1 vote

Will it restrict the information being stored at the browser cache.

+1 vote

We are in the beginning of the migration to struts2 and it seems like there will be some period when both frameworks will be active at the same time..the only problem now is accessing the session beans managed by struts2 in struts1 and vice-versa form beans from strut1 mapped in struts2 . Half of the jsp would use struts1 tags and other half struts2 tags. So there should be beans instantiated in both frameworks.

Probably struts2 bean can be injected to struts1 action with struts1 form still accessible as execute() argument, but what about other way? accessing struts1 form bean (not just data, but managed bean) in struts2 execute() ?

+1 vote

Just after updating struts to 2.3.15.2, all of ours applications stop working. Some of ours applications uses struts-convention-plugin, so only url can be used to access action's methods.

We are using a lot of url with "!input" methods, especially to manage form input and form validation.

"S2-019 - Dynamic Method Invocation disabled by default", seems to be a big security issue. So, is it safe to re-enable back DMI to true ? If not, how is it possible to not use DMI ?

...