Forums de discussion

Liferay <portlet:actionURL>

Seeya S Kudtarker, modifié il y a 11 années.

Liferay <portlet:actionURL>

Regular Member Publications: 187 Date d'inscription: 16/01/13 Publications récentes
In my jsp I have the following code:

<portlet:actionURL name="addDetails" var="addDetailsURL" />

<aui:form name="addDetails" action="<%=addDetailsURL.toString() %>" method="post" >
<aui:input type="text" label="name:" name="name" value="" />
<aui:input type="text" label="surname:" name="surname" value="" />
<aui:input type="text" label="age:" name="age" value="" />

<aui:button type="submit" value="addDetails" />


</aui:form>



I want to submit this data which will be processed in a java class. my java class has few functions. how should I specify in the above jsp that it should access the particular function in java after submitting the form?


Sounds silly but I am confused..


One more question: how does actionURL resolve the namepsace. I mean how does it know which function in java class it should go to..
thumbnail
Gnaniyar Zubair, modifié il y a 11 années.

RE: Liferay <portlet:actionURL>

Liferay Master Publications: 722 Date d'inscription: 19/12/07 Publications récentes
You have to go through the ACTION / RENDER URL behaviors in Portlet life cycle

Action URL calls processAction of your portlet
Render URL calls render / View Method

When you submit the Action URL, it will go and check the processAction method of your portlet class which you have defined in portlet.xml

<portlet-class>
com.my.package.CustomPortlet
</portlet-class>
vinod kumar, modifié il y a 11 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 64 Date d'inscription: 04/10/12 Publications récentes
hi seeya
by default when u call the <portlet:actionURL/>in your jsp it will hit to the processaction() function in your java class

now you r using
<portlet:actionURL name="addDetails" var="addDetailsURL" />.

when you r using name="addDetails" attribute in u'r actionurl it will hit to the addDetails() function
so you are suppose to create addDetails() in your java class

Regards,
vinod
Seeya S Kudtarker, modifié il y a 11 années.

RE: Liferay <portlet:actionURL>

Regular Member Publications: 187 Date d'inscription: 16/01/13 Publications récentes
Thanks Vinod!!

That was great help!! emoticon It cleared my doubts!! emoticon
thumbnail
Hisham Zoghbi, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 32 Date d'inscription: 28/03/17 Publications récentes
hello guys!

im trying to add my Methods from my Action Class to my View.jsp and i've got this:
/view.jsp(21,20) PWC6031: Unterminated &lt;portlet:actionURL tag
javax.portlet.PortletException: org.apache.jasper.JasperException: /view.jsp(21,20) PWC6031: Unterminated &lt;portlet:actionURL tag
at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:267)
at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:102)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:594)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:610)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.doView(MVCPortlet.java:160)
at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:303)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:497)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.render(MVCPortlet.java:317)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
<portlet:actionURL = name="actionMethod1" var="patientSubmitURL"
windowState="normal"></portlet:actionURL>
<form action=${patientSubmitURL} method="post">
<div class="form-inline">
<div class="input-group">
<span class="input-group-addon"><span
class="glyphicon glyphicon-open-file"></span></span> <input
type="nummer" class="form-control"
placeholder="Patient/in Akten-Nr" size="70"
name="<portlet:namespace/>aktenNr" />
</div>
</div>
</form>
I might be wrong with the implementation.
For Help i'll be Thankful
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Hisham Zoghbi:
<portlet:actionURL = name="actionMethod1" var="patientSubmitURL"


This line has an equals sign that doesn't belong there (the first one in the line). That might be what upsets the XML parser.
thumbnail
Hisham Zoghbi, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 32 Date d'inscription: 28/03/17 Publications récentes
i just fixed it thanx. but when i press the Button i get nothing No response?
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Hisham Zoghbi:
i just fixed it thanx. but when i press the Button i get nothing No response?


well, with that much ("zero") information, you won't get any response here as well... Now it's a matter of what your code does - seems it doesn't do what you expect it to do.
thumbnail
Hisham Zoghbi, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 32 Date d'inscription: 28/03/17 Publications récentes
fair enough!!
by changing the Mistake that you've just saw "=" and run my Portlet again. I just got the same Exception as the first one.
<portlet:actionURL name="actionMethod1"" var="patientSubmitURL" />
<form action=${patientSubmitURL} method="post">

<div class="form-inline">
<div class="input-group">
<span class="input-group-addon"><span
class="glyphicon glyphicon-open-file"></span></span> <input
type="nummer" class="form-control"
placeholder="Patient/in Akten-Nr" size="70"
name="<portlet:namespace/>aktenNr" />
</div></div>
<button type="submit" value="Send SMS"></button>
</form>
this is how my View.jsp looks like. With the actionMethode @ProcessAction(name = "actionMethode1")
I have create actionURL by portlet:actionURL tag. name attribute of this tag is same as name attribute of @ProcessAction annotation of portlet action method. So this actionURL is used to calls portlet action method
thumbnail
Hisham Zoghbi, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 32 Date d'inscription: 28/03/17 Publications récentes
i think that was more than a zero informationemoticon
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Hisham Zoghbi:
fair enough!!
by changing the Mistake that you've just saw "=" and run my Portlet again. I just got the same Exception as the first one.
<portlet:actionURL name="actionMethod1"" var="patientSubmitURL" />
<form action=${patientSubmitURL} method="post">

...

this is how my View.jsp looks like. With the actionMethode @ProcessAction(name = "actionMethode1")
I have create actionURL by portlet:actionURL tag. name attribute of this tag is same as name attribute of @ProcessAction annotation of portlet action method. So this actionURL is used to calls portlet action method


I've emphasized a few places that look weird. Check if they're due to anonymization of this post or actual things in your code. In order of appearance:
  • actionMethod1 vs (later) actionMethode1
  • superfluous quote
  • missing quotes
  • see above, already mentioned.

I'm just getting rid of the obvious first.

Next thing to check: Did you override processAction as well? Because the default implementation will do the Annotation lookup. If you've already implemented this method, you might have omitted the default handler.
thumbnail
Hisham Zoghbi, modifié il y a 6 années.

RE: Liferay <portlet:actionURL>

Junior Member Publications: 32 Date d'inscription: 28/03/17 Publications récentes
thankx alot it works now emoticon