struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Newsgroup ( <>
Subject jsp exception with useBean . <%= ...%>
Date Sun, 24 Feb 2002 01:40:01 GMT
Subject: jsp exception with useBean . <%= ...%>
From: Les Dunaway <>

I'm feeling very dumb here.  I'm using struts templates and they work, 
but when I imbed a <%= someid.someMethod() %> in a sidebar.jsp which was 
put'ed and then get'ed, I get jsp exception.  When I run with 
sidebar.html (below) all is well.

Is it allowed to use <%= ...%> in a .jsp processed by 
template.put/get????  Or is there some incantation I've ommitted?



> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <%@ page language="java" %>
> <jsp:useBean id="draw" class="DrawSidebar" scope="application" />
> <%= draw.getSidebar() %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>

<table width="100%" valign="top" align="left" bgcolor="cyan">
<tr width="100%">
	<td width="100%" align="center">
     	<font size="+2"><b>
		<IMG SRC="/images/narrowLogo.jpg" alt="HighGear Logo" ALIGN="top"></a>
		<hr size="5" width="80%">
		<a href="navigate.jsp">About Us</a><br><hr size="5" width="80%">
         <a href="navigate.jsp">Services</a><br><hr size="5" width="80%">
         <a href="navigate.jsp">Appointments</a><br><hr size="5" 
         <a href="navigate.jsp">Check Your Job</a><br><hr size="5" 
/* Generated by Together */

public class DrawSidebar {
     public String[] getButtons(){
             return buttons;

     public void setButtons(String[] buttons){
             this.buttons = buttons;

     public String getSidebar(){
         wrk.append("<table width=\"100%\"/>" + "<font size=\"+2\"><b>");
         wrk.append("<IMG SRC=\"/images/narrowLogo.jpg\" alt=\"HighGear 
Logo\" ALIGN=\"top\"></a>");
// rest of it
         sidebar = wrk.toString();
         return sidebar;

     private StringBuffer wrk;
     private String[] buttons = {"About 
Us","Services","Appointments","Check Your Job"};
     private String sidebar;

<%@ taglib uri="struts-template.tld" prefix="template" %>

<template:insert template="/pageTmplt.jsp">
  <template:put name="title" content="HighGear" direct="true"/>
  <template:put name="header" content="/header.html" />
  <template:put name="sidebar" content="/sidebar.jsp" />
  <template:put name="content" content="/about.html"/>
  <template:put name="mainFooter" content="/mainFooter.html" />
   <template:put name="pageFooter" content="/pageFooter.html" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="struts-template.tld" prefix="template" %>
   <title><template:get name="title"/></title>

   <link href="css/base.css" rel=stylesheet>

   <meta name="charset" content="ISO-8859-1">

   <meta name="generator" content="Screem 0.4.1">
<table width="800" border="1" bgcolor="White">
     <tr valign="Top">
       <td width="150">
       	<template:get name="sidebar"/>
       <table border="1" width="650">
             <td><template:get name="header"/><br>
             	<template:get name="content"/><br>
             <td><template:get name="mainFooter"/><br>
       <td colspan="2"><template:get name="pageFooter"/></td>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message