留言板

Go from 1 jsp page to another one in same portlet.

Pavel Ivanov,修改在11 年前。

Go from 1 jsp page to another one in same portlet.

New Member 帖子: 17 加入日期: 12-8-22 最近的帖子
Hi , i m trying to make redirect from 1 pahe to another with :
if (bIsVoted == true) {
%>
<script type="text/javascript">

<meta http-equiv="refresh" content="0; url=vote-portlet/completed.jsp">

</script>
<%
} else {
//VotedPeople.add(signedInAs);
%>

<script type="text/javascript">
<meta http-equiv="refresh" content="0; url=vote-portlet/edit.jsp">
</script>
<%
}
%>

and i have error with it. Whats wrong? Or there will be any another way 2 do it?

I m novice in Java/JSP so i ask you about complete answer pls.
thumbnail
Ibrahim Mahammad,修改在11 年前。

RE: Go from 1 jsp page to another one in same portlet.

Junior Member 帖子: 47 加入日期: 11-11-30 最近的帖子
Pavel,

Specify what error your getting with this?
thumbnail
Sushil Kumar Saini,修改在11 年前。

RE: Go from 1 jsp page to another one in same portlet.

Regular Member 帖子: 104 加入日期: 11-7-27 最近的帖子
Hi Pavel,

Try the following code for redirect. I am using it my application and working fine for me.


<script type="text/javascript">
   window.location="http://www.redirecturl.com";
</script>



Cheers
Sushil Saini
Pavel Ivanov,修改在11 年前。

RE: Go from 1 jsp page to another one in same portlet.

New Member 帖子: 17 加入日期: 12-8-22 最近的帖子
Thx for an answer, but it doesnt work properly. That script opens new page not in a portlet window.
thumbnail
Vishal Panchal,修改在11 年前。

RE: Go from 1 jsp page to another one in same portlet.

Expert 帖子: 289 加入日期: 12-5-20 最近的帖子
Pavel Ivanov:
Thx for an answer, but it doesnt work properly. That script opens new page not in a portlet window.


Hi Pavel,

You may either use

self.location = url;

or

window.location.assign(url);

Hope it will help you.!

Thanks&Regards,
Vishal R. Panchal