struts2

Can I call a Struts2 action on click of a html link in html page.

I want a Struts2 action to be performed on click of a html link in a html page. My first question is whether is it possible to perform a Struts2 action in a html page(not JSP)? If yes, take a look at my code below: home.html href="home.action" struts.xml action name="home" class="com.struts.action.HomeAction" result nam...

Converting a Servlet to Struts2 Action Class

I'm porting a dynamic web project to Struts2 and I gotta convert a many servlets to Struts2 actions. I want to use the ServletRequestAware, ServletResponseAware and SessionAware interfaces and keep most of the code unchanged. Please take a look at BaseAction.java class which I found by GOOGLin'. I want to use this so that i can make othe...

I need to implement an Auto complete Utility using Struts2-JQuery plugin.

There is an inbuilt tag for this purpose. User enters a character in the textbox, Strings which start with the character entered should be displayed in the form of a list. The item selected from the list should be populated in the textbox. P.S: The examples and demo available display Strings that contain the character entered. But I w...

My own content management system on Struts how do i proceed?

I am trying to build a Content Management System in java I wish to use Struts as my MVC framework.How should i proceed and what things should i need to keep in mind while developing my own CMS?How should i design my database.? I am working on a project where i will require managing user articles,events,communities..etc. ...

Struts2: Own interceptor and valueStack

Hi! Recently I needed to implement an interceptor that got the result of executing an action, and if that result was INPUT then execute a method that fetched some lists from the db. I just need to execute that method if the result is INPUT, because it's the only time when I'll need to populate some lists on the jsp. So I wanted to avoid...

Struts2 a tag`s problems

Hi here is a tiny part of my struts2 code. I am using struts2 tag "a" to carry out my functionality. <s:a href="%{Num}" name="delete"> However, when this converted to plain HTML code, it becomes <a id="delete" href="/WorldExpo/deleteproduct.action?productcode=FLAG_AT"> I am wondering why the HTML tag "a" has got id="delete" rather...

What is the best approach to handle session timeouts in struts2

I have a struts2 app and I need to handle the session-timeout in the logged section. What I have in mind is to use an Interceptor class : public class SessionInterceptor extends AbstractInterceptor { @Override public String intercept(ActionInvocation invocation) throws Exception { Map<String,Object> session = invocation.getIn...

where to find a open source project which uses one of more of (spring,struts2,hibernate,JSF)

Hi everyone, I would like to involve in a open source project, since I prefer web development and frameworks such as spring, struts2, Hibernate and JSF, I'd like to find such a project to get involved. Can someone point me to right direction or correct me if I'm search something that didn't exists? Thank in advance, Nuwan ...

simple OGNL projection required in struts2

Hello, I would like to create a really simple tag parameterized with a collections' ids something like the following: <s:url action="theaction" namespace="/" includeParams="all" id="histURL"> <s:param name="sources" value="sources.{id}"></s:param> </s:url> ${histURL} If I have say three Source objects defined in my Action class, h...

Stryts-JQuery Plugin Issue With Double Select

I have the following code to do a doubleselect using Struts2 and the jquery plugin: jsp: <s:url id="ajaxActionUrl" value="/getStateCodesJson"/> <sj:select name="stateCodeId" id="stateCodeId" label="State" href="%{ajaxActionUrl}" onChangeTopics="reloadSecondSelect" list="stateCode...

How should I initialize class freemarker.template.Configuration?

Attempting to follow this Java tutorial. About 63 pages in, you are instructed how to create a form ("New.jsp") to submit new events. When I try to visit the page, I get the following error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this...

Struts2 Validation

In Struts2, can we have both validation xml (ActionClass-method-validation.xml) and validate method implemented in Action class. I was asking as this validation xml don't get invoked in my situation. ...

How do I use typecast in struts2 display tags?

I need to typecast to float so i do some simple math inside the view. To my dismay the following does not work: <s:property value="%{(double)(touristicZones.size()) / 2}"/> but this works fine <s:property value="%{(touristicZones.size()) / 2}"/> ...

Struts2: Download File + WaitAndExecute

Hi at all I have a little problem: I have a action configured with these params: <action name="exportCSV" class="it.asd.ExportAction"> <interceptor-ref name="defaultLoginStack" /> <interceptor-ref name="execAndWait"/> <result name="success" type="stream"> <param name="contentType">application/x-zip-compr...

DB changes listener and web page poll on this changes

I am using Struts2, Spring and Hibernate. Can someone please help me to update the webpage automatically when there is an DB update. Update to DB may not be from application as well, it may be directly to DB. So I need to know the DB update changes and other is how to poll the changes to web page. Thanks in advance ...

What version of HTML is used on Struts Tags?

Are the Struts2 Tags compliant to the HTML 4.01 strict standard, the HTML 4.01 transitional, XHTML 1.1 or something else entirely? ...

Struts2/Hibernate entitity update - null reference.

I have a Struts2 application that uses Hibernate/Spring. I have created an update form using s:select form elements - as in: Select form element is jsp - initialised correctly with current value: <s:select name="model.titleType.id" value="%{model.titleType.id}" list="#titleTypeSelect.titleTypeMap" /> Hibernate mapp...

Struts2: interceptor and parameters

hello, i have done some pages with Struts 2.(J2EE project) All was ok until i try to add an interceptor. It seems that the Interceptor delete all properties of my Class Action and Parameters send by the jsp with url like: action?param=xxx here is the interceptor: public class SessionInterceptor extends AbstractInterceptor{ @O...

i want to show countries in drop down list in jsp page

Hi, i want to show countries in drop down list in jsp page, am using struts 2. i used linked hash map for countries list, please anybody help me how can i do this?. please have a look country.java file posted here. Thanks in advance import java.util.LinkedHashMap; import java.util.Map; public class Country { private static final Lin...

Sitemesh, periodic refresh duplicates header and footer (Struts2 action)

I am using sitemesh defined jsp in decorator xml which needs to be refresh for every min. After refresh the page is duplicating header and footer. I am using jQuery setInterval for refresh every min and given action name in load with div. Can someone please help what are configuration changes I need to do for header footer not to dup...