facebook

Generate java constants for struts-config.xml

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #225519 Reply

    Hi,
    some strings in struts-config.xml and in java source code MUST be identical. Since your struts editor (great tool) has struts-config.xml under complete control, I suggest generating Java-Constants for these cases.

    E.g. a success-connector in struts-config.xml:
    <action
    type=”….struts.action.LoginAction”>
    <forward name=”success” path=”/LogonSuccess.jsp” />
    would produce following constant in a full generated java class named “Tokens”
    public class Tokens {
    final class LoginAction {
    public static final java.lang.String SUCCESS = “success” ;

    The namespace of class “Tokens” has to be organized, because “success” is a name local to LoginAction.

    It would also be fine, if the names of the JSP properties would be java constants, so one could use them in Java to access them, e.g.
    request.setAttribute(Tokens.JSPProperty.userName , … );
    But this seems to me a lot of work to implement, since the property names are only in the wizard properties of that page.

    Klaus

    #225543

    Riyad Kalla
    Member

    Klaus,
    These are all good enhancements, I will suggest them to the Struts team.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Generate java constants for struts-config.xml

You must be logged in to post in the forum log in