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 ...
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!
...
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...
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 ...
Can I use Struts as a backend and PHP as front end for a web application? If yes, what may be the implications.
...
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...
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...
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 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?
...
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:
...
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...
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 ...
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 ...
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 ...
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
...
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...
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 ...
Which Ajax framework/toolkit can you recommend for building the GUI of web applications that are using struts?
...
Can ZK easily be integrated in a struts web application?
...
Should I use the GWT for a struts web application?
...