This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

the foward at the bottom  RSS feed

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The foward does nto work, I get a blank page and no errors in the logs. What is the problem?

<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>
<%@ page import="gsptech.portal.beans.*"%>
<%@ page import="gsptech.portal.biz.*"%>
<jsp:useBean id="userBean" class="gsptech.portal.beans.UserBean"/>
<jsp:useBean id="linkBean" class="gsptech.portal.beans.LinkBean"/>
<%
userBean = (UserBean)application.getAttribute("gsptech.portal.beans.UserBean");

Activity login_activity = (Activity)session.getAttribute("LOGIN_STATISTICS");
try
{
if( login_activity == null || !userBean.isSessionValid(login_activity) )
{
String error = "/jsp/notloggedin2.jsp?message=You are not allowed to view this link because you are not logged into the portal";
System.out.println("--Attempted Link when not logged in--");
%><jsp:forward page="<%= error %>"/><%
}
}
catch (Exception e)
{ System.out.println("OOPS, Problem checking the status of the User in Display: " + e); }
User user = (User)session.getAttribute("user");
linkBean = (LinkBean)application.getAttribute("gsptech.portal.beans.LinkBean");
Link link = new Link();
link = linkBean.getLink(Integer.parseInt(request.getParameter("linkid")));

String description = link.getSubtitle();
String next_url = link.getURL();
//System.out.println(description);
if (description!=null)
{
if (description.equals("FedExBrand"))
{
next_url = link.getURL() + "?subscriber=" + user.getLoginName();
}
}
Activity activity = new Activity();
activity.setStartTime(new java.sql.Timestamp(System.currentTimeMillis()));
activity.setEndTime(new java.sql.Timestamp(System.currentTimeMillis()));
activity.setLoginName(user.getLoginName());
activity.setLinkId(Integer.parseInt(request.getParameter("linkid")));

userBean.logActivity(activity);
System.out.println(next_url);
%>
<jsp:forward page="<%= next_url %>"/>
 
C Kutler
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this is old, but I am curious what server you are using. I think there was a bug with Tomcat 5, which might have been fixed in Tomcat 5.0.19, that the server does not evaluate scriptlets and scriplets expressions in the page attribute of a jsp:include action. Could the same be true for forwards? I wonder.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!