top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is it possible to have access to form beans from struts1 in struts2

+1 vote
497 views

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() ?

posted Apr 14, 2014 by Kaushik

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

When we do such a migration we usually take care that one HTML page is handled completely by one framework. Intercation between frameworks just happens via HTML links or HTTP redirects.

If you really have to access struts1 form beans in struts2 actions, have a look under which key they are stored in httpSession and access them just with that key.

answer Apr 14, 2014 by Jagan Mishra
Similar Questions
+1 vote

I am migrating an application from Struts 1 to Struts 2 and frequently I am facing scenarios where I need to use request.getSession to set/get attributes. As far as my knowledge goes, this is not considered to be a best practice in Struts 2. What is the best was way to handle this scenario?

+1 vote

I have a requirement to use Struts 2.x framework for new modules in the existing web application which is currently running on Struts 1.x

I would like to have both configuration separately and I don't wish to migrate or touch any of existing source files.

Could you please provide me any sample application or user guide or any related information for my requirement? Appreciate your kind help on this.

+1 vote

Which features of S2 use ASM?

The S2 project dependencies (http://struts.apache.org/release/2.3.x/struts2-core/dependencies.html ) shows that xworks depends on:

- asm-3.3.jar
- asm-commons-3.3.jar
- asm-tree-3.3.jar

These ASM jar don't seems to actually be needed by a project I have so I'm guessing they are only needed for some specific feature. Does anyone know which features need ASM?

...