Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Seeya S Kudtarker
Liferay <portlet:actionURL>
March 10, 2013 11:51 PM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

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..
Gnaniyar Zubair
RE: Liferay <portlet:actionURL>
March 11, 2013 12:20 AM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 622

Join Date: December 19, 2007

Recent Posts

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>
kumar E
RE: Liferay <portlet:actionURL>
March 11, 2013 12:20 AM
Answer

kumar E

Rank: Junior Member

Posts: 64

Join Date: October 3, 2012

Recent Posts

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
RE: Liferay <portlet:actionURL>
March 11, 2013 12:27 AM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

Thanks Vinod!!

That was great help!! emoticon It cleared my doubts!! emoticon
Hisham Zoghbi
RE: Liferay <portlet:actionURL>
August 22, 2017 7:31 AM
Answer

Hisham Zoghbi

Rank: Junior Member

Posts: 32

Join Date: March 28, 2017

Recent Posts

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
Olaf Kock
RE: Liferay <portlet:actionURL>
August 22, 2017 8:48 AM
Answer

Olaf Kock

LIFERAY STAFF

Rank: Liferay Legend

Posts: 4149

Join Date: September 23, 2008

Recent Posts

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.
Hisham Zoghbi
RE: Liferay <portlet:actionURL>
August 22, 2017 8:52 AM
Answer

Hisham Zoghbi

Rank: Junior Member

Posts: 32

Join Date: March 28, 2017

Recent Posts

i just fixed it thanx. but when i press the Button i get nothing No response?
Olaf Kock
RE: Liferay <portlet:actionURL>
August 22, 2017 8:55 AM
Answer

Olaf Kock

LIFERAY STAFF

Rank: Liferay Legend

Posts: 4149

Join Date: September 23, 2008

Recent Posts

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.
Hisham Zoghbi
RE: Liferay <portlet:actionURL>
August 22, 2017 9:14 AM
Answer

Hisham Zoghbi

Rank: Junior Member

Posts: 32

Join Date: March 28, 2017

Recent Posts

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
Hisham Zoghbi
RE: Liferay <portlet:actionURL>
August 22, 2017 9:17 AM
Answer

Hisham Zoghbi

Rank: Junior Member

Posts: 32

Join Date: March 28, 2017

Recent Posts

i think that was more than a zero informationemoticon
Olaf Kock
RE: Liferay <portlet:actionURL>
August 22, 2017 3:47 PM
Answer

Olaf Kock

LIFERAY STAFF

Rank: Liferay Legend

Posts: 4149

Join Date: September 23, 2008

Recent Posts

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.
Hisham Zoghbi
RE: Liferay <portlet:actionURL>
August 23, 2017 4:34 AM
Answer

Hisham Zoghbi

Rank: Junior Member

Posts: 32

Join Date: March 28, 2017

Recent Posts

thankx alot it works now emoticon

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!