Skip to content
Advertisement

Tag: struts2

Struts2 jQuery UI dynamic Menu from Action List

How can I generate dynamic menu & menu items from a list generated at Action? I tried this approach but it is generating only main menu but not sub-menus. Action class: JSP: What can i do to get Menu with menu items? Example classes structure: How to configure this in JSP page with sj:menu tag? Answer The <sj:menu> tag generates

Where is the best place to begin transaction using Hibernate in a tired web application with Struts 2?

I got this Java web application which uses Struts 2 and Hibernate. In the most upper layer comprises of the Struts 2 action classes. Then there are my business logic classes which are responsible for the logic of the application. Finally there is a DAO layer (called Database Bridge) which is responsible for communicating with the database. Currently I open

How to pass an object from front-end to Struts 2

I am trying to send value of a field to Struts2 back-end through JavaScript but it returns NullpointerException. Once form is submitted the request will be sent to the following JavaScript method to be sent to back-end. the request will be created and sent as following But in back-end when I try to show the value it returns NullPointerException. Java:

How to pass an action name using hyperlink in Struts 2?

I have a hyperlink named “Click for new User”. Once I click the link, I got NullPointerException instead of opening RegisterPage.jsp page. I post my code here, I can’t find my mistake index.jsp: struts.xml: Login.java(Action Class): Exception: Answer When you click on hyperlink you don’t supply the request URL with parameters username and password (the parameters aren’t set by the

How to use DispatcherListener in Struts 2

There is a interface DispatcherListener in Struts2. The docs says “A interface to tag those that want to execute code on the init and destroy of a Dispatcher.” But how to use this interface. If I create a class that implements this interface, how should I configure it to Struts2? Answer When a Dispatcher is instantiated, it could send to

Advertisement