Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form tag prepending context/servlet path breaks use for portlets [SPR-10382] #15015

spring-issuemaster opened this issue Mar 14, 2013 · 3 comments


Copy link

@spring-issuemaster spring-issuemaster commented Mar 14, 2013

Kevin Wilkinson opened SPR-10382 and commented

When using the form tag for portlets, prepending the portlet's context is not wanted since we want the url to resolve to the portal's context and not the portlet's(where the form tag lives). The portlet url tags generate portlet urls within the jsp like
which resolve to /uPortal and not /PortletName

<form:form modelAttribute="itemForm" method="post" action="/uPortal/f/s70/p/portlet-name/normal/action.uP?pP_javax.portlet.action=saveItem">

renders as

<form id="itemForm" action="/PortletName/uPortal/f/s70/p/portlet-name/normal/action.uP?pP_javax.portlet.action=saveItem" method="post">

The original idea was to have the adding-context functionality off by default and turned on by an added parameter but it wasn't implemented. That way it wouldn't break anything while letting new apps take advantage of the shortcut.

Affects: 3.2.1, 3.2.2

Reference URL:

Issue Links:

  • #15016 Form tag does not resolve action correctly in portlet environment ("is duplicated by")
  • #13326 Form tag should prepend the contextPath and servletPath if not present
  • #18097 Update reference documentation for spring JSP Tag Library

Referenced from: commits c0cacfc, 399f887

2 votes, 7 watchers

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 15, 2013

Rossen Stoyanchev commented

This is the 3.2.1 commit that introduced the change. We'll have it fixed in 3.2.3.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 30, 2013

Sindri Traustason commented

I've managed to find a workaround for this by having the portal call WebUtils.exposeForwardRequestAttributes() before forwarding to the portlet application. This causes the form tag to use the portals context path instead of the portlet applications path.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 10, 2013

Rossen Stoyanchev commented

I've reverted to the previous behavior of not prepending and added a new FormTag attribute called servletRelativeAction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.