kaqqao
kaqqao

Reputation: 15459

In Struts 1, how to specify input page URL and not path to JSP

I have a very annoying problem with Struts. The input page is located under an URL similar to this: /news/send/. URLs of this type are required by the CMS we're using. In struts-config.xml, as action input I can only specify the path to the JSP file, e.g.

<action path="/send" type="org.example.SendAction" name="sendForm" scope="request"
       input="/WEB-INF/jsp/send.jsp" validate="true" />

The part that bugs me is input="/WEB-INF/jsp/send.jsp". I need it to be something like: input="/news/send/" but it just gives me a 404 when I try that. It seems to require a path to a JSP, and the JSP as such does not exist, it's generated by the CMS when the above URL is accessed.

Since this page is needed only if validation is enabled, I can disable the validation and validate manually in the action, but I'd much rather avoid that.

Any ideas?

Thanks for any insight.

Upvotes: 0

Views: 678

Answers (1)

kaqqao
kaqqao

Reputation: 15459

I learned in the mean time that Struts can not forward to a resource that does not yet exist, so using redirects is the only option in such cases, and since validation errors always result in a forward, it's impossible to use the validation mechanism here.

Upvotes: 1

Related Questions