struts

How can I refactor HTML markup out of my property files?

I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: <p> <bean:message key="alert" /> </p> and the properties files look like: messages.properties alert=Please update your <a href="/address.do">address</a> and <a href="/contact.do">contact information</a>. with ...

How I hide empty Velocity variable names ?

I am using Struts + Velocity in a Java application, but after I submit a form, the confirmation page (Velocity template) shows the variable names instead an empty label, like the Age in following example: Name: Fernando Age: {person.age} Sex: Male I would like to know how to hide it! ...

Reading model objects mapped in Velocity Templates

Hello, I have a Struts + Velocity structure like for example, a Person class, whose one property is a Car object (with its own getter/setter methods) and it is mapped to a Velocity form that submits to an Action, using ModelDriven and getModel structure. I what to put a button on the form that shows "View Car" if car property is not nu...

Changing default file structure in a Java Struts App

Hey, I have been working with Struts for some time, but for a project I am finishing I was asked to separate Templates (velocity .vm files), configs (struts.xml, persistence.xml) from main WAR file. I have all in default structure like: application |-- META-INF -- Some configs are here |-- WEB-INF ...

PHP and J2EE

Can I use Struts as a backend and PHP as front end for a web application? If yes, what may be the implications. ...

How can I set the welcome page to a struts action?

I have a struts-based webapp, and I would like the default "welcome" page to be an action. The only solutions I have found to this seem to be variations on making the welcome page a JSP that contains a redirect to the action. For example, in web.xml: <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> a...

What's main differences between "new" ASP.NET MVC framework and typical Java Struts projects ?

I'm more a Java developer than a .Net guy but It seems to me that new Microsoft MVC's framework seems like typical combination of Java existing projects like : Struts (for handling the MVC), Hibernate (for object to SQL mapping, like LINQ), and URL rewriting to handle pretty URLs (that's less common). Also, It seems to me very simila...

Struts 2: return to calling page

Hi there. I'm using Struts 2. I'd like to return from an Action to the page which invoked it. Say I'm in page x.jsp, I invoke Visual action to change CSS preferences in the session; I want to return to x.jsp rather than to a fixed page (i.e. home.jsp) Here's the relevant struts.xml fragment: <action name="Visual" class="it.___.w...

Struts 1.3: forward outside the application context?

Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location. That seems kinda sucky. Is there a better way? ...

Can I submit a Struts form that references POJO (i.e. not just String or boolean) fields?

I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. so my form looks something like: MyForm extends ActionForm { private String name; private int id; private Thing thing; ...getters/setters... } In the JSP I can reference the POJO's fields thusly: ...

ResourceBundle from Java/Struts and replace expressions

If I have a Resource bundle property file: A.properties: thekey={0} This is a test And then I have java code that loads the resource bundle: ResourceBundle labels = ResourceBundle.getBundle("A", currentLocale); labels.getString("thekey"); How can I replace the {0} text with some value labels.getString("thekey", "Yes!!!"); Such...

Best practice: How to handle concurrency of browser and website navigation.

It is a well known problem to every web developer. As far as I tried to find a good solution to this problem - there was none (or at least I could not find it). Lets assume the following: The user does not behave, as he was expected to. The actual project I'm working in uses a navigation within the web portal. But if the user uses the ...

In Struts 1.3, what's the best way for the Controller to fill the View with variables ?

I've just inherited some old Struts code. If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ? So far, I've seen the Action classes push variables in (1) the HTTP request with request.setAttribute("name", user.getName()) (2) in ActionForm classes, using methods specific ...

Has anyone migrated from Struts 1 to another web framework?

On my current project, we've been using Struts 1 for the last few years, and ... ahem ... Struts is showing its age. We're slowly migrating our front-end code to an Ajax client that consumes XML from the servers. I'm wondering if any of you have migrated a legacy Struts application to a different framework, and what challenges you faced ...

struts action controller - multithreaded?

when they say the action controller in the struts framework is multi threaded, does it mean that there are multiple instances of the servlet taking the request and forwarding it to the model. OR does it mean that there is one single instance taking all the requests? Any visuals will be appreciated ...

How to get real request URL in struts with tiles?

When you use tiles in struts and do request.getRequestURL() You get url to /WEB-INF/jsp/layout/newLayout.jsp instead of real URL that was entered/clicked by user, something like /context/action.do. In new struts versions, 1.3.x and after, you can use solution mentioned on javaranch and get real url using attribute ORIGINAL_URI_KEY at...

How do I submit multiple models in Struts 2?

I have a JSP that allows users to dynamically create additional form fields to create multiple objects. Perhaps I want to allow users to be able to submit as many line items as they want when submitting an invoice form. How do I create a Struts 2 Action that will be able to take in an ArrayList populated with objects created from those ...

AJAX-Framework

Which Ajax framework/toolkit can you recommend for building the GUI of web applications that are using struts? ...

ZK ajax framework

Can ZK easily be integrated in a struts web application? ...

Google Web Toolkit

Should I use the GWT for a struts web application? ...