Formatting fonts within jsp:getProperty tag????
I'd diplaying a piece of information on one of my pages using the jsp:getProperty tag.... there seems to be no way I can effect the display of the property with the font/color that I want - when I look at the resulting HTML code, I see that this tag has created a new HTML table specifying the class "inFieldSet" (a CSS class I presume, and which I also presume if overriding my desired font/color settings). Is there a way to make the page display the property using the font/color that I want without writing a custom tag?
Scott
All the JSP getProperty tag does, is get a string returning the value of a property. It would not apply any formatting to your page.
I would take a look at the "getter" for this property to see what value it is returning.
Most probably it is returning a chunk of preformatted html.
Similar Messages
-
Populating combobox in jsp page from javabean using jsp:getProperty tag
hi,
i am new to jsp, so i don;t know how to populate a combobox in jsp page with productid attribute from a javabean called Bid . i want to have a code to automatically populating combobox using the attribute value from javabean.
please reply me.
<jsp:useBean id="bidpageid" class="RFPSOFTWARE.Bid" scope="session" />
<jsp:setProperty name="bidpageid" property="*"/>
<table width="50%" align="center" border="0">
<tr>
<td width="30%" align="left"><h4><b><label>Date (dd/mm/yyyy) </label></b></h4> </td>
<td><input type="text" name="date" size="11" maxlength="10" readonly="readonly" value="<jsp:getProperty name="bidpageid" property="date"/>" > </td>
</tr>
<tr> <td > </td> </tr>
<tr>
<td width="30%" align="left"><h4><b><label>ProductId </label></b></h4> </td>
<td><select name="productid" tabindex="1" size="1" >
<option value="<jsp:getProperty name=bidpageid" />Sachin</option>
<option value="Hello">Vishal</option>
</select></td>
</tr> and the javabean for Bid is as follow :
import java.util.Date;
import RFPSOFTWARE.Product;
public class Bid{
private Product product;
private Integer bid_id;
private String description;
private Date date= new Date();
public Integer getBid_id() {
return bid_id;
public Date getDate() {
return date;
public String getDescription() {
return description;
public Product getProduct() {
return product;
public void setBid_id(Integer bid_id) {
this.bid_id = bid_id;
public void setDate(Date date) {
this.date = date;
public void setDescription(String description) {
this.description = description;
public void setProduct(Product product) {
this.product = product;
}No Sir,
I think I did not explained clearly.what I try to say is I dont want to use JSTL.I am using only Scriptlets only.I can able to receive the values from the database to the resultset.But I could not populate it in Combobox.
My code is :
<tr>
<td width="22%"><font color="#000000"><strong>Assign To Engineer</strong></font></td>
<td width="78%">
<select NAME="Name" size="1">
<option><%=Username%></option>
</select> </td>
</tr>
in HTML
and in Scriptlets:
ps1 = con.prepareStatement
("SELECT Username FROM Users");
rs2=ps1.executeQuery();
System.out.println("SECOND Succesfully Executed");
while(rs2.next())
System.out.println("Coming inside rs2.next loop to process");
Username=rs2.getString("Username");
System.out.println("Success");
System.out.println("The value retrieved from UsersTable Username is:"+Username);
In the server(Jboss console) I can able to display the username but I could not populate it in the Combobox .
Can you now suggest some changes in my code,Please..
Thanks a lot
With kind Regds
Satheesh -
Help with JSP:GetProperty Tag
Howdy all,
I have a
<jsp:getProperty name='input' property='code01'/>
tag and would like to be able to put a variable in the property field so that I can increment from code01 to code02 to code 03 by concatenating strings
Is this possible?Thanks for your input on the forum, but I tried with no sucess to put it into action:
<% String colname="code02"; %>
<jsp:getProperty name='Input' property='<%=colname%>' />
Produced this:
Internal Servlet Error:
org.apache.jasper.JasperException: Cannot find any information on property '' in a bean of type 'com.infomed.InputBean'
at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:616)
at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:101)
at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:771)
at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:220)
at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:175)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Any Help you can give would be greatly appreciated, what I need to do is cycle through code01, code02....code15
and use the string to do it, but use a counter integer to create the string, ie..'code0' + i and then use the sting to access
on of the member properties in the been...(Code01, Code02) ertc. -
Jsp:getProperty in tag attributes
Hii....
I have a custom tag that displays some information based on an attribute of the tag. I want to set information from a bean to the attribute using the jsp:getProperty tag...
I want to do something like.......
<mytagprefix:MyTag attribute1='<jsp:getProperty id="myID" property="name"/>' />
If I do it right now I am getting the string <jsp:getProperty id="myID" property="name"/> inside the my TAG.
any help will be appreciated.
sanjay.I'm a bit rusty on custom tags, so maybe this isn't the best solution, but until you find a better one you can try '<%= myID.getName() %>' as the attribute.
-
hi everyone,
I am fairly new to JSP and I am trying to understand some of the basics of JSP, so I am wondering if anyone can tell me if the JSP usebean tag case sensitive, for example I have this, which works perfectly fine:
For JSP page:
<%@ page language="java" import="simple.simplebean" %>
<jsp:useBean id="sample" class="simple.simplebean" scope="page">
</jsp:useBean>
<html>
<body>
<jsp:setProperty name="sample" property="sample" value="IT Works!" />
<jsp:getProperty name="sample" property="sample" />
Hope this works and it does work
</body>
</html>
For JavaBean:
package simple;
import java.io.*;
public class simplebean implements Serializable
private String Sample;
public simplebean(){}
public void setSample(String s) {Sample=s;}
public String getSample() {return Sample;}
But, if I have this:
<jsp:setProperty name="sample" property="Sample" value="IT Works!" />
<jsp:getProperty name="sample" property="Sample" />
It won't work because "S" is capital for the property attribute "Sample", which is really strange, so I am wondering what is the limitation in the usage of <jsp:setProperty> and <jsp:getProperty> tag?
I am can I do this?:
<jsp:setProperty name="sample" property="setSample" value="IT Works!" />
<jsp:getProperty name="sample" property="getSample" />
The setSample and getSample method name.Whenever you declare a variable, industry standard says that the variable name should begin with a lowecase letter. Hence
private String Sample;
should be declared as:
private String sample;
If you have a variable name with more that two words then the first letter of the first word should be lower case and the 2nd word should be uppercase. For example:
private String mySample;
The industry standard also says that if you are creating a class then the first letter of every word should be capitalized. Hence, when you declare a class it should be as follows:
public class SimpleBean{}
Not:
public class simplebean{}
The reason the industry standard is done this way is to make it easy to distinguish between classes and variables and it makes it easier to read variable and class names.
Imagine trying to read a variable name like this:
private String thisismypersonalvar;
as opposed to this:
private String thisIsMyPerasonalVar;
The latter is easier to read. The same applies for classes.
Also, when the first letter of a variable name is lowecase then everyone knows that it is a variable and not a class. Likewise when a classname is capitalized everyone knows that it is a class.
For example:
String myString = "this is a string";
I know that String is a class because the first letter is capitalized and I know that myString is a variable name because the first letter is lowercase.
It may seem silly but when you are debugging over 500 lines of code then it makes it much easier to understand which name is a class and which one is a variable name.
After all that being said.
if you were to use
<jsp:setProperty name="sample" property="setSample" value="IT Works!" />
<jsp:getProperty name="sample" property="getSample" />
this would not work because the name of the property in the Bean is "Sample".
if this code did not work
<jsp:setProperty name="sample" property="Sample" value="IT Works!" />
<jsp:getProperty name="sample" property="Sample" />
then I would assume that the jsp specification automatically assumed that all the bean property names would begin with a lowercase letter, therefore, it expects the bean property name to be lowercase when it is passed as a parameter to the property attribute.
For example, the following code you wrote is correct:
<jsp:setProperty name="sample" property="sample" value="IT Works!" />
<jsp:getProperty name="sample" property="sample" />
If your bean property was
private String mySample;
then the signatures of the get and set method would be:
public void setMySample(String a);
public String getMySample();
The get and set property in the JSP page would be:
<jsp:setProperty name="sample" property="mySample" value="IT Works!" />
<jsp:getProperty name="sample" property="mySample" />
I hope this helps.
logikalone -
How come property attribute of jsp:getProperty knows which method to call
Hello friends,
I could not understand How come property attribute of <jsp:getProperty knows which method to call
<jsp:useBean id="test" class="BeanTest.testing" scope="page" />
<jsp:getProperty name="test" property="name" />
there is no method "name" in testing.class file
if u see the existing examples "date" given in TOMCAT , it is using many <jsp:getProperty tag, but the property name is not equal to the method method name in the Bean file
thanks,First do you know what a
bean property sheet is?
If not say so.
Second, to your question
The Java Runtime Environment (JRE) uses introspection to identify the appropriate get() or set() methods of that bean. What is introspection?
Introspection is a process that allows the class to expose its accessable variables and methods and allows other classes to see what they can do with that class when requested. Eg:
public class MyBean{
private String someValue = null;
public MyBean(){
someValue = "Some String Value";
//Introspection will reveal this method
public String getSomeValue(){
return someValue;
} and
<jsp:getProperty name="...." property="someValue" />
will call the getSomeValue() method -
Scriptlet within a jsp:include tag
In Jrun 2.3.3 you could include a scriptlet within a <jsp:include> tag like this:
<%
String language = "E";
%>
<jsp:include page="/Conditions<%= language %>.html"/>
Since I have to programme for four languages on our site, I used this convenient way of including different language pages on the fly all over the site.
I then had a problem with 2.3.3 so I got 2.3.8 and discovered that all of these jsp:includes with scriptlets didn't work any more.
I hastily uninstalled 2.3.8 and have continued with 2.3.3 ever since, thinking that they would sort this out in 3.0., which they didn't.
Presumably to deal with this when I want to upgrade JRun I will have to use a load of if{} statements instead, but for four languages I will need four if {} statements which is incredibly long-winded compared to the single line of code above.
<%
if(language.equals("E")){
%>
<jsp:include page="/ConditionsE.html"/>
<%
%>
Can anybody help:
1) by giving me a neater solution that the one I've come up with.
2) by explaining what happened at JRun to cause this change.
Thanks.I could be wrong, but at least with WSAD (WebSphere), I couldn't do this:
<html:text maxlength="14" size="10" property="proofOfClaim[<%=memberAccountIndex%>].sentDate%>"/>
but could do this:
<% String property = "proofOfClaim[" + memberAccountIndex +"].sentDate"; %>
<html:text maxlength="14" size="10" property="<%=property%>%>"/>
I think the reason is that since <html:text> is a custom tag, any scriptlets <%=...%> must be the ENTIRE value, and not be inserted in the middle of a value, for an attribute. Try it out. :) -
Nesting a BC4J JSP data tag within a Struts tag?
Has anybody tried nesting a BC4J JSP data tag within a Struts JSP tag? I can't get it to work. For example,
<logic:equal name="sort" value="<jbo:ShowDefinition datasource='ds' dataitem='CustomerName' definition='ColumnName' />">
blah blah blah
</logic:equal>Try using single quotes in the value=' ' and double quotes in the jbo tag usage.
-
jsp:getProperty.... in a taglib-tag ???
Hi !
I have taglib where I have defined a lots of classes and one of them I have a attribute who should be dynamic. I have tryed this:
<easyTagz:submit iteration='<jsp:getProperty name='submission' property='maxCount'/>' />
but it dosen`t seem to work....
Any suggestion :-)Dosen`t seem to work, have tryed and gets this error message:
org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:567)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
Any suggestion ??? -
Combining jsp getProperty with HTML EMBED
Hi, Just a quick question, I have a couple of JSP/HTML books and I can't find a way of achieving this;
basically I have a webpage that embeds a VRML file like so
<EMBED SRC="/VRML/stair.WRL"
TYPE="model/vrml"
WIDTH="300"
HEIGHT="300"
VRML_SPLASHSCREEN="TRUE"
VRML_DASHBOARD="TRUE"
VRML_BACKGROUND_COLOR="#0066CC"
CONTEXTMENU="TRUE"
>
This works fine, the problem is that I now have a servlet that dynamically generates the VRML file to be displayed, so I need a way of inserting this variable into the EMBED header, how do I do this?
If it can't be done with JSP etc then how about a JavaScript solution?
Anyway, ive tried a few things and Im out of ideas
Cheers
PS, the current JSP property finder;
<jsp:useBean id="vrmlFileFinder"
type="legato.VRMLBean"
scope="request" />
<jsp:getProperty name="vrmlFileFinder" property="fileName" />There are two issues here
1 - generating the WRL file (from your servlet)
2 - generating the EMBED tag in the HTML/JSP page
These are two different requests to the web server.
1- generating the WRL file:
You say you have a servlet which generates the VRML code?
Does it generate it to file, or output it directly?
If it outputs it directly, just point the src of the tag to be your servlet
ie
<EMBED SRC= "/servlet/VRMLServlet"...
This will invoke your servlet, and return the code to the browser. (ie as long as the servlet sends it a WRL text format, it can't tell the difference)
2 - generating the EMBED tag:
If you want to dynamically choose which file to include, then JSP would do it like this:
<jsp:useBean id="vrmlFileFinder" type="legato.VRMLBean" scope="request" />
<EMBED SRC="<jsp:getProperty name="vrmlFileFinder" property="fileName" />"...
Remember that the JSP code gets executed first, so if the property evaluates to "/VRML/stair.WRL" all the browser will see is
<EMBED SRC="/VRML/stair.WRL" - it doesn't see the JSP code at all.
Hope this helps.
Cheers,
evnafets -
Problem with flush=true in the jsp:include tag
Hello
I have deployed a JSP based application , based on the apache struts framework. The web server is Sun One Webserver 6 Service Pack4, on a windows 2000 machine
The same application was tried on SunONE application server 7, and it works without any problem. However in this case the following error , on the page
javax:servlet.jspexception:Illegal to flush within a custom tag
Does this mean flush="true" is not allowed within custom tags
Or is there a workaround for this
Any help is appreciated
thanks
- AniruddhaHi,
This is a known problem, ��flush before you include�� limitation in JSP 1.1.
As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
Gary Wang
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/ -
Tiles + JSF error (Illegal to flush within a custom tag)
Hi,
When I try to use Tiles + JSF I have this error message :
javax.servlet.jsp.JspException: Illegal to flush within a custom tag
I am already using flush="false" on my tiles:insert tag.
This is my .jsp code :
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert beanName="cadastro_base" beanScope="request" flush="false">
<tiles:put name="form_body" type="string">
<f:view>
<h:form id="DisciplinaJsfBean" binding="#{DisciplinaJsfBean.form}" >
<h:inputText id="codigo" binding="#{DisciplinaJsfBean.itCodigo}"/>
</h:form>
</f:view>
</tiles:put>
</tiles:insert>
And this is the stack trace message :
exception
javax.servlet.ServletException: Illegal to flush within a custom tag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:99)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
root cause
javax.servlet.jsp.JspException: Illegal to flush within a custom tag
com.sun.faces.taglib.jsf_core.ViewTag.doEndTag(ViewTag.java:223)
org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_f_view_0(cadastrarDisciplinas_jsp.java:205)
org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_put_0(cadastrarDisciplinas_jsp.java:157)
org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_insert_0(cadastrarDisciplinas_jsp.java:122)
org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
Danilo.What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
I'm using this with JSF so it may be different for you:
... Layout stuff ...
<tiles:insert attribute="body" flush="false" />
... More layout stuff, including more inserts with the flush="false" .... -
Can EJB's be called from within JSP pages?
Hi,
(This is a general question, not necessarily related to OAS in any way...)
I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
Any help would be appreciated. Thanks!
David Christopher
[email protected]Hi,
Check the following code: http://www.jguru.com/jguru/faq/view.jsp?EID=5314 for ejb example.
-Ruchi
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Davidc:
Hi,
(This is a general question, not necessarily related to OAS in any way...)
I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
Any help would be appreciated. Thanks!
David Christopher
[email protected]<HR></BLOCKQUOTE>
null -
Javax.servlet.ServletException: Illegal to flush within a custom tag
Hi ,
I am developing a sample application for JSF , Tiles and Spring when i uses JSF with tiles i am getting the error
javax.servlet.ServletException: Illegal to flush within a custom tag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.pages.main_jsp._jspService(main_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
Here is the My master tiles layout file
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<HTML>
<HEAD>
<TITLE><tiles:getAsString name="title"/></TITLE>
</HEAD>
<BODY>
<TABLE border="0" width="100%" cellspacing="5">
<TR>
<TD colspan="2"><tiles:insert attribute="header" flush="false" /></TD>
</TR>
<TR>
<TD width="140" valign="top">
<tiles:insert attribute='menu' flush="false"/>
</TD>
<TD valign="top" align="left">
<tiles:insert attribute='body' flush="false"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<tiles:insert attribute="footer" flush="false"/>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
and here is the main.jsf
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="/pages/template.jsp" flush="false" >
<tiles:put name="title" value="Hello World" />
<tiles:put name="header" value="/pages/header.jsp" />
<tiles:put name="body" type="string">
<f:view>
<h:form id="catalogMenu">
<table border="1" align ="center" >
<tr>
<td><a href="<img src="../images/image1.gif"><br>Struts in Action<br><a href="Add to Cart $39.00</td>
<td><a href=" <img src="../images/image2.gif"><br>Juint in Action<br><a href="Add to Cart $35.00</td>
</tr>
<tr>
<td><a href="<img src="../images/image3.gif"><br>Hibernate in Action<br><a href="Add to Cart $50.00</td>
<td> <a href="<img src="../images/image4.gif"><br>Spring in Action<br><a href="Add to Cart $54.00</td>
</tr>
</table>
</h:form>
</f:view>
</tiles:put>
</tiles:insert>
can any body please suggest why i this exception is comingWhat worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
I'm using this with JSF so it may be different for you:
... Layout stuff ...
<tiles:insert attribute="body" flush="false" />
... More layout stuff, including more inserts with the flush="false" .... -
Tomcat4: Illegal to flush within a custom tag
I tried to deploy to Tomcat4.1.18 a jsp-struts application developed with JDeveloper 9.0.3.1, simply obtained using the "Complete Struts-Based JSP Application" Wizard.
When I access to a page containing the
"jbo:DataRecord" tag or the "jbo:DataTable" I get this exception in the error log file (I do not know if other tags give this same error, but for example "jbo:DataScroller" does not):
2003-04-15 09:28:35 ApplicationModule release mode is: Stateful
2003-04-15 09:28:36 jsp: init
2003-04-15 09:28:37 jsp: init
2003-04-15 09:28:37 IO Error
java.io.IOException: Illegal to flush within a custom tag
at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115)
at oracle.jbo.html.jsp.datatags.ComponentTag.doStartTag(ComponentTag.java:69)
at org.apache.jsp.PazientiDateEventiViewLink1_0005fDateEventiEventiViewLink1$jsp._jspService(PazientiDateEventiViewLink1_0005fDateEventiEventiViewLink1$jsp.java:157)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:417)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:390)
at oracle.jbo.html.struts11.BC4JRequestProcessor.processActionForward(BC4JRequestProcessor.java:98)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:429)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:495)
at java.lang.Thread.run(Thread.java:484)
2003-04-15 09:28:46 jsp: init
2003-04-15 09:28:46 ApplicationModule release mode is: Stateful
Deploying on a standalone OC4J everything works.
Is there some configuration to add to the web.xml file or somewhere else? I tried also on Tomcat 4.0.3 with same results.
I added this lines in web.xml to avoid the problems descripted in thread BC4J entity objects vs EJB2.0 entity beans
<init-param>
<param-name>enablePooling</param-name>
<param-value>false</param-value>
</init-param>
Other non-struts-based webapps developed with JDev 9.0.2 and 9.0.3 were deployed correctly on Tomcat 4.1.18.
Thanks,
Marco.Hi Steve,
I looked better at my page and it has been modified from that produced by the wizard. In fact, the problem arises substituting a DataTable tag with a RowsetIterate in which I put a DataRecord.
Here there is a simple page which produces this error (I see the error only in the error log of Tomcat localhost_log.txt, not on the page):
<%@ page language="java" import="oracle.jbo.*" errorPage="errorpage.jsp" contentType="text/html;charset=windows-1252" %>
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html>
<head>
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<LINK REL=STYLESHEET TYPE="text/css" HREF="bc4j.css">
<TITLE><bean:message key="browse.title"/></TITLE>
</head>
<body>
<jbo:DataTransaction appid="Test3Module" />
<h3><bean:message key="browse.header" arg0="CategoryView1"/></h3>
<table border="0">
<tr>
<td ALIGN="right"><jbo:DataScroller datasource="Test3Module.CategoryView1"/></td>
</tr>
<tr>
<%-- REPLACED DataTable WITH a RowsetIterate in which I put a DataRecord --%>
<jbo:RowsetIterate datasource="Test3Module.CategoryView1" userange="true" >
<td>
<jbo:DataRecord datasource="Test3Module.CategoryView1" />
</td>
</jbo:RowsetIterate>
<%--
<td><jbo:DataTable datasource="Test3Module.CategoryView1" edittarget="/edit_CategoryView1.do"/></td>
--%>
</tr>
</table>
</body>
</html>
In this case, it is not so hard to avoid to put in the pages such a code.
Thanks,
Marco.
Maybe you are looking for
-
How can you get itunes to recognize your ipod?
i already installed itunes and everything.After I plugged the ipod in and it just wont recognize it. Im desperate
-
Font size incorrect when printing smartform
Hi, I have a smartform containing many smaller windows with frames. One big window should show a word in grey and in big letters behind all the other windows. In my smartstyles, I have used the font family "HELVE", font style bold and the size 72. Wh
-
Hi i have a table named "gatepass" in database A. i created public synonym (create public synonym gatepass for schema.gatepass@databaselink) in database B for the table "gatepass" in database A. when i query that table in db B through SQL prompt, it
-
Hi all, I need some Operator help. I have a computer with ODI Operator. When I expand the "Status" node I can see the status and the number of processes in each status, but I can't see the records inside. The same goes for expanding the "All Executio
-
Cisco CRS Historical Reports error "run time error 364 application defined or object-defined error"
Hi All, we are getting an error when we open historical report