Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 1:45 AM
RE: hyperlink in JSP using LR6.0.6 Anil Sunkari February 20, 2013 2:21 AM
RE: hyperlink in JSP using LR6.0.6 Kowbathullah Gnaniyar February 20, 2013 2:25 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 3:23 AM
RE: hyperlink in JSP using LR6.0.6 Kowbathullah Gnaniyar February 20, 2013 3:28 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 3:46 AM
RE: hyperlink in JSP using LR6.0.6 Kowbathullah Gnaniyar February 20, 2013 3:52 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 3:59 AM
RE: hyperlink in JSP using LR6.0.6 Kowbathullah Gnaniyar February 20, 2013 4:09 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 5:43 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 7:17 PM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 8:12 PM
RE: hyperlink in JSP using LR6.0.6 Kowbathullah Gnaniyar February 23, 2013 12:12 AM
RE: hyperlink in JSP using LR6.0.6 kumar E February 23, 2013 2:01 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 24, 2013 7:33 PM
RE: hyperlink in JSP using LR6.0.6 Manish Kumar February 20, 2013 4:08 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 5:45 AM
RE: hyperlink in JSP using LR6.0.6 Manish Kumar February 20, 2013 6:05 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 7:25 AM
RE: hyperlink in JSP using LR6.0.6 Manish Kumar February 20, 2013 3:11 AM
RE: hyperlink in JSP using LR6.0.6 Zeeshan Khan February 20, 2013 3:43 AM
Zeeshan Khan
hyperlink in JSP using LR6.0.6
February 20, 2013 1:45 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Hi All,

I am trying to put a hyperlink using href in my portlet but its not working....i am writing :


<portlet:renderURL var="viewGreetingURL">
<portlet:param name="jspPage" value="/view2.jsp" />
</portlet:renderURL>

and then : td align="center" >
<p><a href="<%= viewGreetingURL %>">&larr; Back</a></p>
</td>


but after clicking on the link in jsp , it goes to blank page.....also in address bar it shows "http://localhost:8080/web/null"

and in the console, it shows-----> 09:40:41,266 ERROR [ActionURLTag:68] Render response is null because this tag is not being called within the context of a portlet
09:40:43,452 INFO [PortalImpl:3829] Current URL /web/null generates exception: {groupId=10133,privateLayout=false} does not have any layouts
09:40:43,453 INFO [PortalImpl:3841] {groupId=10133,privateLayout=false} does not have any layouts
Anil Sunkari
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 2:21 AM
Answer

Anil Sunkari

Rank: Expert

Posts: 427

Join Date: August 11, 2009

Recent Posts

Please refer the below url..

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/understanding-the-two-phases-of-portlet-executi-4
Kowbathullah Gnaniyar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 2:25 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

Manish Kumar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:11 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Hello Zeeshan,
Where are you using both the tags i.e. <portlet:renderURL> and <a href> ?
I think there is scope problem, try to use this <portlet:renderURL> outside where it will be in scope of the <a>tag.

Thanks,
Manish Kumar
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:23 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

thanks for the reply guys....i tried ur solution but no luck...... emoticon

I just want a href link which redirects to another JSP page.....please find the attached files for better understanding.

From view1.jsp, i want to go to view2.jsp. please have a look at the files.


THANKS !
Attachments: JSPPortlet.java (1.7k), view.jsp (5.7k), view1.jsp (3.2k), view2.jsp (0.1k)
Kowbathullah Gnaniyar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:28 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

Instead of extending Generic:

JSPPortlet extends GenericPortlet


extend MVCPortlet like this:

MyPortletClass extends com.liferay.util.bridges.mvc.MVCPortlet
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:43 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Hi Manish,

thnx for the reply.

<portlet:renderURL> and <a href> both are with reference with liferay developer guide actually.
Is Ajax code creating problem fron view.jsp.....??




Manish Kumar:
Hello Zeeshan,
Where are you using both the tags i.e. <portlet:renderURL> and <a href> ?
I think there is scope problem, try to use this <portlet:renderURL> outside where it will be in scope of the <a>tag.

Thanks,
Manish Kumar
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:46 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Gnaniyar Zubair:
Instead of extending Generic:

JSPPortlet extends GenericPortlet


extend MVCPortlet like this:

MyPortletClass extends com.liferay.util.bridges.mvc.MVCPortlet



Zubair, I have tried by extending by MVCPortlet but still not working.....
Kowbathullah Gnaniyar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:52 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

Hope MyPortletClass has been declared in portlet.xml.

Just do onething, mention renderURL on top of the jsp page .
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 3:59 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Gnaniyar Zubair:
Hope MyPortletClass has been declared in portlet.xml.

Just do onething, mention renderURL on top of the jsp page .



Hi Zubair,

I did what u say.....PFA view1.jsp, portlet.xml and portlet class.

thanks !
Attachments: JSPPortlet.java (1.6k), portlet.xml (1.1k), view1.jsp (3.3k)
Manish Kumar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 4:08 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Hello Zeeshan,
I saw your code, What i can see that you may have missed the full path of the view2.
1<portlet:renderURL var="viewGreetingURL">
2<portlet:param name="jspPage" value="/html/newportlet/view2.jsp" />
3</portlet:renderURL>


I tried like this when i have my both the jsps in the same folder of /html/newportlet. So you need to check the full path in your project.
This code is working fine for me after i made the changes.

Hope this will help you.
Thanks,
Manish Kumar
Kowbathullah Gnaniyar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 4:09 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

If you dont want to override the MVCPortlet class then you can give direct path. Otherwise should give like this:

<portlet-class>com.liferay.mypath.JSPPortlet</portlet-class>


But that is not a actual problem in your case. Send me the war file..will have a look.
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 5:43 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Gnaniyar Zubair:
If you dont want to override the MVCPortlet class then you can give direct path. Otherwise should give like this:

<portlet-class>com.liferay.mypath.JSPPortlet</portlet-class>


But that is not a actual problem in your case. Send me the war file..will have a look.




Zubair, I have just come back from the office.....Can I give u the WAR file tomorrow....

Thanks !!
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 5:45 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Manish Kumar:
Hello Zeeshan,
I saw your code, What i can see that you may have missed the full path of the view2.
1<portlet:renderURL var="viewGreetingURL">
2<portlet:param name="jspPage" value="/html/newportlet/view2.jsp" />
3</portlet:renderURL>


I tried like this when i have my both the jsps in the same folder of /html/newportlet. So you need to check the full path in your project.
This code is working fine for me after i made the changes.

Hope this will help you.
Thanks,
Manish Kumar



Hi Manish,

Actually I have placed my JSPs directly under Docroot folder, not under any folder. So I guess I am giving right path. I think problem is somewhat with scope.
Manish Kumar
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 6:05 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Hi Zeeshan,
The code is fine but You need to override the MVC Portlet as Gnaniyar Zubair is suggesting.
Extending the Generic Portlet is the issue.

Thanks.
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 7:25 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Manish Kumar:
Hi Zeeshan,
The code is fine but You need to override the MVC Portlet as Gnaniyar Zubair is suggesting.
Extending the Generic Portlet is the issue.

Thanks.


I also did that too Manish...... emoticon
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 7:17 PM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Zubair, PFA war file....

thanks !
Attachments: TestiGate-portlet.war (18.1k)
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 20, 2013 8:12 PM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Also the same code i.e. <portlet:renderURL var="viewGreetingURL">
<portlet:param name="jspPage" value="/view2.jsp" />
</portlet:renderURL>
<a href="<%= viewGreetingURL %>"> Back</a>


is working on view.jsp but not working on view1.jsp....i dont know why it is happening....
Kowbathullah Gnaniyar
RE: hyperlink in JSP using LR6.0.6
February 23, 2013 12:12 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

Please check the attached war file.

How it will work if you comment the renderURL....? emoticon


<%-- <portlet:renderURL var="viewGreetingURL">


--%>
Attachments: TestiGate-portlet.war (17.6k)
kumar E
RE: hyperlink in JSP using LR6.0.6
February 23, 2013 2:01 AM
Answer

kumar E

Rank: Junior Member

Posts: 64

Join Date: October 3, 2012

Recent Posts

hi
Zeeshan Khan

if u r using custom class
remember one thing if u are using renderURL in your jsp
when u click on that link it will hit to the

protected void include(String path, RenderRequest renderRequest,RenderResponse renderResponse) method in your custom class

their you have to provide your jsp path.

check the following link once

http://grepcode.com/file/repo1.maven.org/maven2/com.liferay.portal/util-bridges/6.0.5/com/liferay/util/bridges/mvc/MVCPortlet.java
Zeeshan Khan
RE: hyperlink in JSP using LR6.0.6
February 24, 2013 7:33 PM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Gnaniyar Zubair:
Please check the attached war file.

How it will work if you comment the renderURL....? emoticon


<%-- <portlet:renderURL var="viewGreetingURL">


--%>



Zubair, I solved it by removing Ajax part....please have a look at the attached file and suggest.....
Attachments: view.jsp (8.4k)