Custom JSP Tags for Weblogic
Hi,
I have several questions regarding this topic:
1) Does Weblogic 5.1 supports Custom Tags ? If so, are there any known
problems ?
2) Does Weblogic come with any tag libraries (for loops, if, etc) and where
can I get them ?
3) Are there any tag libraries out there (JRun, for example) that have been
successfully run on Weblogic ?
Any help would be much appreciated.
Thanks,
Jamie
As there seems to be general interest, a link would probably be a great
help.
Regards
Daniel Hoppe
-----Original Message-----
From: Michael Girdley [mailto:[email protected]]
Posted At: Friday, August 25, 2000 8:03 AM
Posted To: jsp
Conversation: Custom JSP Tags for Weblogic
Subject: Re: Custom JSP Tags for Weblogic
Please see the documentation:
http://www.weblogic.com/docs51/resources.html
Michael Girdley
BEA Systems Inc
"Jamie" <[email protected]> wrote in message
news:[email protected]...
> Update
> =======
>
> Weblogic Portal has some Tag libraries. I've downloaded the trial
version
> of
> the Weblogic Commerce Server. How do I get the tag libraries and use
them
> on WL 5.1 ?
>
> Answers to original post still wanted
>
> Thanks,
>
> Jamie
>
> Jamie <[email protected]> wrote in message
> news:[email protected]...
> > Hi,
> >
> > I have several questions regarding this topic:
> >
> > 1) Does Weblogic 5.1 supports Custom Tags ? If so, are there any
known
> > problems ?
> >
> > 2) Does Weblogic come with any tag libraries (for loops, if, etc)
and
> where
> > can I get them ?
> >
> > 3) Are there any tag libraries out there (JRun, for example) that
have
> been
> > successfully run on Weblogic ?
> >
> >
> > Any help would be much appreciated.
> >
> > Thanks,
> >
> > Jamie
> >
> >
>
>
Similar Messages
-
Problems in developing custom JSP tags
I have problems in debugging custom JSP tags. Sometimes the doStartTag is not called on tags but the doEndTag is called. I don't know why.
Thanks.Fahr--
A word of caution -- NetUI did not ship a JSP tag SDK in 8.x, and
we're making no compatibility guarantees for custom JSP tags written on
the 8.x release and future releases.
You can accomplish the same sort of functionality with a combination
of the <netui-data:getData> tag and JSTL 1.0. This solution would
probably provide similar functionality and be more future-proof relative
to JSTL and the NetUI tags currently being developed in Beehive.
Hope that helps.
Eddie
Fahr Vegnugen wrote:
We are in the midst of creating our own JSP tags to work with datasources.
In an example where you would need to compare two different datasources how would you do this?
ie.
<prefix:isGreater dataSource="{pageflow.column1}" dataSourceToCompare="{pageFlow.column2}" />
How would I evaluate what column2 is since the tag will only resolve one data source
this.evaluateDataSource();
Any pointers you can provide would be appreciated, or if there is a library of jsp tags that evaluate objects using datasources already created, that would even be better. -
We have our own custom JSP tag libraries (some of them extend the Struts tags, but many do not) and want those to render correctly in the design view.
Is that supported by NitroX Struts, or will it only work with built-in Struts tags?
If it is supported, how does one get NitroX to run the custom tags?It is possible to customize many aspects of the rendering of a custom tag. This is done using a combination of an M7 specific metadata, and standard css rules.
For example, you can change the label, icon and border of a custom tag by doing the following steps:
1) Create a folder named "nitrox" where your tld file is located. For example if you have "/WEB-INF/app.tld" then create a
folder "/WEB-INF/nitrox/".
2) In the nitrox folder created above, create a file named "app.tlei" (for Tag Library Extra Information). The file name used here should match the name of the tld file. In this case "app".
3) Paste the following content in the app.tlei file:
<taglib-extrainfo>
<css-uri>app.css</css-uri> <!-- an optional css file relative to this tlei file -->
<tag name="myTag">
<display-name>My Tag</display-name> <!-- The name displayed in the Tag Libraries view -->
<rendering-label>{tag-name} ({name})</rendering-label> <!-- This will display the value of the "name" attribute in addition to the tag name in the tag view in the JSP design editor. -->
<small-icon>images/myTag.gif</small-icon> <!-- The image uri relative to this tlei file. This is used in the Tag Libraries view and in the JSP design editor.-->
</tag>
</taglib-extrainfo>
All customization tags are optional.
4) Create the css file referenced from the tlei file above (in this example app.css in the same directory containing the tlei file).
5) Paste the following content in the app.css file:
myTag {border: 1 solid red; display: "inline"}
This will render the tag as inline (i.e as one graphical object) even if the tag has nested content.
In addition, you can use any standard css style property.
You can customize other tags in the same fashion.
If a custom tag inherits from a Struts tag, then the tag can inherit the full built-in tag customization as shown in the following example:
Suppose you have a tag named "myText" that extends the Struts html:text form field tag. To inherit the NitroX html:text customization you follow the steps:
1) insert the following in the tlei file described above:
<tag name="myText">
<inherit taglib-uid="http://jakarta.apache.org/struts/tags-html" tag-name="text" />
</tag>
2) Insert the following css rule in the css file referenced from the tlei file:
myText {m7-inherit: "input-text"; display: inline}
This will inherit the built-in css style for form text fields.
Likewise, you can inherit the other Struts tags css styles by using the following rules:
myPassword {m7-inherit: "input-password"; display: inline}
myCancel {m7-inherit: "input-submit"; display: inline}
myCheckbox {m7-inherit: "input-checkbox"; display: inline}
myRadio {m7-inherit: "input-radio"; display: inline}
mySelect {m7-inherit: "select"; display: inline}
myTextarea {m7-inherit: "textarea"; display: inline}
3) The inherited tag library file (in this example the struts-html.tld), must also be present under the WEB-INF directory.
M7 Support -
Problems with custom JSP Tag, can someone offer some advice?
Greetings,
I have a problem here that I am stumped on. I am trying to create a custom JSP tag, I created a simple "Hello World" JSP, however, I am coming up a bit short. I am running Apache Tomcat 6.0 on a Win XP environment.
The code I have is as follows:
TLDTest.tld:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.2</jspversion>
<shortname>firstTag</shortname>
<info>My First Tag</info>
<!-- Here goes nothing!!! -->
<tag>
<name>hola</name>
<tagclass>Hola</tagclass>
<bodycontent>empty</bodycontent>
<info>a simple hello tag</info>
<!-- attributes -->
<!-- Personalize the name -->
<attribute>
<name>name</name>
<required>false</required>
<rtexpvalue>false</rtexpvalue>
</attribute>
</tag>
</taglib>
The Hola.jsp is:
<%@ taglib uri="/Hola" prefix="test" %>
<html>
<head>Just a little test on tags</head>
<body>
<hr />
<test:Hola name="Woot Master" />
<hr />
</body>
</html>
And the source code for the .class file (named Hola) is:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class Hola extends TagSupport
private String name = null;
public void setName(String value)
name = value;
public String getName()
return(name);
/* doStartTag is called and defined below here for the java tag */
public int doStartTag()
try
JspWriter out = pageContext.getOut();
out.println("<table border=1>");
if (name != null)
out.println("<tr><td> Hola " + name + "!" + "</td></tr>");
else
out.println("<tr><td> Hola! Porque tu es una piquito perra? </td></tr>");
catch (Exception ex)
throw new Error("Dio's Mio!, Esta No Va!, tu problema es en la StartTag!!!");
return SKIP_BODY;
/* doEndTag is defined here. */
public int doEndTag()
try
final JspWriter out = pageContext.getOut();
out.println("</table>");
catch (final Exception ex)
throw new Error("Oops, it's broken, check your coding in the End tag!!!");
What I keep getting is the following error:
org.apache.jasper.JasperException: /Hola/Hola.jsp(6,2) No tag "Hola" defined in tag library imported with prefix "test"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
I've been back and forth on this, but I am lost. Obviously I am missing something, but what is it? It wouldn't be in the web.xml file would it? I am running a vanilla tomcat install. Any help that anyone can provide would be greatly appreciated.
Sincerely,
- JoshOk
1 - In the JSP, your tag should be "hola" not "Hola". Yes case matters.
<test:hola name="Woot Master" />2 - Importing the taglibrary correctly.
Either reference its tld <%@ taglib uri="/WEB-INF/Hola.tld" prefix="test" %>
(and have the tld file sitting in /WEB-INF/Hola.tld )
or
Define a uri for it in the tld...
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.2</jspversion>
<shortname>firstTag</shortname>
<uri>http://mytag/hola</uri>
...and then use that uri to import it in your JSP
<%@ taglib uri="http://mytag/hola" prefix="test" %>
3 - Put your tag class in a package. Classes not in packages have a way of not being found.
package mypackage
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class Hola extends TagSupport {
...That will move it in your folder structure to be /mypackage/Hola.java
You would also need to update the tagclass element in the tld to reflect the change:
<tagclass>mypackage.Hola</tagclass>4 - Mistake in your tld: You are missing an "r" in "rtexprvalue". <rtexpvalue> should be <rtexp*r*value>
5 - In your Tag class, you should return something from the "doEndTag()" method.
return super.doEndTag(); or maybe return EVAL_PAGE;
Revised code:
WEB-INF/hola.tld
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.2</jspversion>
<shortname>firstTag</shortname>
<uri>http://mytag/hola</uri>
<info>My First Tag</info>
<!-- Here goes nothing!!! -->
<tag>
<name>hola</name>
<tagclass>mypackage.Hola</tagclass>
<bodycontent>empty</bodycontent>
<info>a simple hello tag</info>
<!-- attributes -->
<!-- Personalize the name -->
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
</taglib>hola.jsp:
<%@ taglib uri="http://mytag/hola" prefix="test"%>
<html>
<head>Just a little test on tags</head>
<body>
<hr />
<test:hola name="Woot Master" />
<hr />
</body>
</html>Hola.java. Compiles into WEB-INF/classes/mypackage/Hola.class
package mypackage;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class Hola extends TagSupport {
private String name = null;
public void setName(String value) {
name = value;
public String getName() {
return (name);
/* doStartTag is called and defined below here for the java tag */
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.println("<table border=1>");
if (name != null)
out.println("<tr><td> Hola " + name + "!" + "</td></tr>");
else
out.println("<tr><td> Hola! Porque tu es una piquito perra? </td></tr>");
} catch (Exception ex) {
throw new Error("Dio's Mio!, Esta No Va!, tu problema es en la StartTag!!!");
return SKIP_BODY;
/* doEndTag is defined here. */
public int doEndTag() {
try {
final JspWriter out = pageContext.getOut();
out.println("</table>");
return super.doEndTag();
} catch (final Exception ex) {
throw new Error("Oops, it's broken, check your coding in the End tag!!!");
}Cheers,
evnafets -
Jsp tag for blog attribute in a flex asset
hi Experts,
I am using FW7.6.1, I have a flex asset with a blob attribute, when I create that flex asset, I can upload an image in that attribute, but I did not find a jsp tag for rendering that attribute which has a image saved, another question is what jsp tag should be used in case of a word file is uploaded in that attribute, that's to say:
1. for a image, I want to display it in browser.
2. for a word file, I want to show popup window to ask user if he wants to download or open.
By using assetset:getattributevalues and render:stream, it's just for string type of attribute, not for blog.
Thanks in advance.
Best regardshi all,
I got the answer from dev guide, seems should use:
<blobservice:gettablename varname="uTabname"/>
<blobservice:getidcolumn varname="idColumn"/>
<blobservice:geturlcolumn varname="uColumn"/>
and render:satelliteblob
some complicated then I expected.
Best regards -
JSP tags for managing MBeans??
Hi,
I'm trying to build a GUI for managing a custom MBean. The MBean implementation is a wrapper for a singleton class (specifically, a Configuration class for a web app). I've tried using WebJMX, but the problem there is that it relies heavily on MX4J, and has not kept up with JMX advances in the last two years (MX4J is a bit ahead of weblogic 8.1).
Just as there is a set of console extension jsp tags, I suspect that a set of JSP tags exists for the developers of the Weblogic console to write their JSP pages to manage the weblogic MBeans. I coud just try to figure out the pattern of the INPUT and FORM tags in the html, but that leaves me with a possibly-inaccurate, version-dependent, non-dynamically-generated page to manage one MBean.
Does such a set exist? Could someone point me to any information about how to use such a set of tags?
I would like to be able to have the JSP I use for my console extension display an interface for modifying MBean configurable fields and executing MBean operations. What would the best way be to do this? I do not want to embed the Sun JMX RI in my web-app and launch a separate HtmlAdaptor listening on a different port. I would like the admin to the MBean be accessible through (and only through) the weblogic console.
Thanks in advance for the help,
Matt GeisHi,
I'm trying to build a GUI for managing a custom MBean. The MBean implementation is a wrapper for a singleton class (specifically, a Configuration class for a web app). I've tried using WebJMX, but the problem there is that it relies heavily on MX4J, and has not kept up with JMX advances in the last two years (MX4J is a bit ahead of weblogic 8.1).
Just as there is a set of console extension jsp tags, I suspect that a set of JSP tags exists for the developers of the Weblogic console to write their JSP pages to manage the weblogic MBeans. I coud just try to figure out the pattern of the INPUT and FORM tags in the html, but that leaves me with a possibly-inaccurate, version-dependent, non-dynamically-generated page to manage one MBean.
Does such a set exist? Could someone point me to any information about how to use such a set of tags?
I would like to be able to have the JSP I use for my console extension display an interface for modifying MBean configurable fields and executing MBean operations. What would the best way be to do this? I do not want to embed the Sun JMX RI in my web-app and launch a separate HtmlAdaptor listening on a different port. I would like the admin to the MBean be accessible through (and only through) the weblogic console.
Thanks in advance for the help,
Matt Geis -
Firstly, thanks for any assistance. The problem I'm facing is that I am using this open source tag library in WebLogic Platform v8.1.5 and it is showing an error when viewed within Workshop. The problematic custom tag was underlined in red by Workshop with the error message "ERROR: This attribute value is not valid." when hovering the mouse over it.
I tried the other JSP tag specified in the tld file and they were ok. I suspect that there might be an error in one of the Java classes that form the JSP tag. As I hardly do much JSP tag, so my question is my hunch correct? Or should I look elsewhere? The JSP tag in question has an empty <bodycontent> and basically exposes some static variables for use in the JSP page. The tld file is as below and the problematic tag is highlighted in bold. Thank you again for any advise given!
<?xml version="1.0"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>theme</shortname>
<uri>http://liferay.com/tld/theme</uri>
<tag>
<name>box</name>
<tagclass>com.liferay.taglib.theme.BoxTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>top</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>bottom</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>defineObjects</name>
<tagclass>com.liferay.taglib.theme.DefineObjectsTag</tagclass>
<teiclass>com.liferay.taglib.theme.DefineObjectsTei</teiclass>
<bodycontent>empty</bodycontent>
</tag>
<tag>
<name>include</name>
<tagclass>com.liferay.taglib.theme.IncludeTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>page</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>param</name>
<tagclass>com.liferay.taglib.util.ParamTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>nvm..i already fix the problem..
-
Error compiling expressions in custom JSP tags
We had the same problem and we have found the same solution. Not to nice.
Jan
Here is what I have set up:
custom.jsp:
<%@ taglib uri="/WEB-INF/tlds/mytags.tld" prefix="my" %>
<!-- <%@ taglib uri="myTags" prefix="my" %> -->
<HTML>
<HEAD>
<TITLE>Custom tag example</TITLE>
</HEAD>
<BODY>
<H1>Custom tag Example</H1>
<my:wrapper style="k001">
<b>hello!</b>
</my:wrapper>
</BODY>
</HTML>
Under WEB-INF/tlds, I placed mytags.tld:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>MyTags</short-name>
<tag>
<name>wrapper</name>
<tag-class>mytaglib.WrapperTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<name>style</name>
<required>true</required>
</attribute>
</tag>
</taglib>
I've seen examples for jsp-version 1.1 and 1.2. Can you suggest what should be placed in <uri>...</uri>
Do you think I have a problem with my tomcat config or compiling the java class?
Thanks. -
Custom login module for weblogic portal 10.3.2
Hi everyone
i want to develop a custom portal login module for weblogic..
can anyone help me out with details how can i implement it ...any links provided will ve very useful
Thanks in advance.The credentials given on that page are wrong for 10.3.2. (They might be correct for 10.3, but that's not my problem.) I found the correct credentials -- weblogic / webl0gic -- at this URL:
weblogic portal 10.3.2 sample domain admin console question
It's also given correctly in section 6 of the Getting Started Guide, but you have to know to look there first.
Edited by: dwschulze on Aug 19, 2010 1:47 PM -
Custom adaptive tags for 6.5 / 10gR3
I'm going through an upgrade, and it seems that while some of the custom adaptive tags developed for 6.1 work in 10gR3, there are some that do not. Before I go about doing the work, I felt that I should ask..has anyone done this yet? I didn't see any .NET dll's in the alui toolbox...
In particular, the tag that I need right now is the pt:standard.openerlink with the ability to display extra parameter(s).This is actually easier than I expected. I don't know why i was scared of creating new tags all these years. A few things that I found...
With friendly urls, when the link is created (using standard.openerlink), the portal needs to look up the object to ensure that its valid (makes sense, otherwise, how would it put the name in the friendly url). I would imagine that this would have performance implications, right? -
Why does people use JSP Tag for their JSP page? (Urgent)
I don't know what benifit if I am using JSP Tag.
If anyone knows, pls give me an idea and the advantage of using JSP Tag in JSP Page!
Thanks in advance!You have to read a little about JSP, JSP stands for JavaServer Pages, you can use jsp tags and you can use java code. If you dont want to use jsp tags then you should just write html file, if you just want to use java, then write java class or a servlet.
The need for jsp arised because people were inserting html code inside a servlet class..a big no no..and a headache. JSP separate model from the view...read a little about MVC-2 model view controller pattern.
Also read some tutorial on this website...good luck
K -
JSP tag for reducing the html output
Hello,
I was wondering if there was a jsp tag that reduce the html output of the jsps. I have tried trimfilter the idea is great but at my project filters should be a subclass of one class that i cant edit.
Thanks for all advices.Instead of this<html>
<body>
Hello World
<!--Some html comment-->
</body>
</html>This would be better.<html><body>Hello World</body></html>Edited by: mehmetcadirci on Jul 17, 2010 1:19 PM -
Hi,
I have a problem while trying to import java classes using
<jsp:directive.page import....... tag.
though the <%@page import = ....... tag works fine...
any help would be appreciated..I can just tell you that this is not working.
Some of the XML JSP tags are simply not implemented by all servlet engines. -
How to pass a server side value to an attribute of a custom jsp tag
Hi All:
I needed to passed an integer value from the following code:
<%=ic.getTotalNumOfRecords()%>
to an attribute of a custom tag
<inquiry:tableClaimHistory numberOfRecords="5" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
The function getTotalNumOfRecords returns an int.
The attribute numberOfRecords expects an string.
Here are the different ways I tried in a jsp page but I get also the following errors:
1.)
>
<%@ include file="../common/page_imports.jsp" %>
<inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
Error Message:
claimHistoryView.jsp:190:3: Unterminated tag.
<inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
2.)
>
<%@ include file="../common/page_imports.jsp" %>
<inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
Error Message:
claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
<inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
3.)
>
<%@ include file="../common/page_imports.jsp" %>
<inquiry:tableClaimHistory numberOfRecords="<%ic.getTotalNumOfRecords();%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
Error Message:
java.lang.NumberFormatException: For input string: "<%ic.getTotalNumOfRecords();%>"
4.)
>
<%@ include file="../common/page_imports.jsp" %>
<%
int records1 = ic.getTotalNumOfRecords();
Integer records2 = new Integer(records1);
String numberOfRecords2 = records2.toString();
%>
<inquiry:tableClaimHistory numberOfRecords="<%numberOfRecords2;%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
error message:
java.lang.NumberFormatException: For input string: "<%numberOfRecords2;%>"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
at java.lang.Double.valueOf(Double.java:447)
at java.lang.Double.(Double.java:539)
at com.DisplayTableClaimHistoryTag.displayTable(DisplayTableClaimHistoryTag.java:63)
5.)
>
<%
int records1 = ic.getTotalNumOfRecords();
Integer records2 = new Integer(records1);
String numberOfRecords2 = records2.toString();
%>
<inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
error message:
claimHistoryView.jsp:194:3: Unterminated tag.
<inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
In the custom tag java code called "DisplayTableClaimHistoryTag"
I tried to used the following code:
>
InquiryContext ic = InquiryContext.getContext(session);
>
The problem is that in order to get session I needed HttpSession object. I don't know how to passed HttpSession "session" object
to a custom tag. Is there a way to do this?
>
public class DisplayTableClaimHistoryTag extends InquiryTag
String numberOfRecords;
public void setNumberOfRecords(String numberOfRecords)
this.numberOfRecords = numberOfRecords;
public String getNumberOfRecords()
return numberOfRecords;
public int doStartTag()throws JspException
InquiryContext context = (InquiryContext)pageContext.getSession().getAttribute(Constrain.CONTEXT);
if(context==null)
throw new JspException(TAG_EXCEPTION+ "InquriyContext is null.");
String hasData = (String)context.getAttribute(Constrain.CONTROL_HAS_DATA);
if(hasData==null)
throw new JspException(TAG_EXCEPTION + "The hasData property can not be null.");
boolean hd = Boolean.valueOf(hasData).booleanValue();
Debug.println("hasData="+hd);
Debug.println("hasDataString="+hasData);
if(hd)
displayTable();
else
disPlayError();
return SKIP_BODY;
private void displayTable() throws JspException
String outString ="";
Debug.println("dispalyTable() ********* dataAction="+ dataAction);
JspWriter out = pageContext.getOut();
* Minimum height height= 103,70
* 21.7 per row
* First row==103+21.5=124.5
* Second row ==103+21.5*2=146
* Third row ==103+21.5*3=167.5
Double numberOfRecordsBigDouble = new Double(numberOfRecords);
double numberOfRecordsDouble = 70 + 21.8*numberOfRecordsBigDouble.intValue();
if(order==null || order.equals("0"))
// outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
// outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
// outString = "<iframe src=\"" + "http://www.google.ca"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
else
String orderStr = "?order=" + order;
outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
//outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\"161\" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
Debug.println("dispalyTable() ********* outString = "+ outString);
try {
out.println(outString);
} catch (IOException e) {
this.log.error(TAG_EXCEPTION + e.toString(), e);
throw new JspException(e);
>
Any hint would be greated appreciated.
Yours,
John SmithOk, couple of things
1 - ALWAYS put quotes around attributes in a custom tag. That rules out items #1 and #5 as incorrect.
2 - You were correct using the <%= expr %> tags. <% scriptlet %> tags are not used as attributes to custom tags. That rules out #3 and #4
#2 looks the closest:
2.)
<%@ include file="../common/page_imports.jsp" %>
<inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>Error Message:
claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
<inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
Check your spelling of that attribute. It looks right here,.
You also said that ic.getTotalNumOfRecords returns an int, while the attribute returns a String
Try
<%@ include file="../common/page_imports.jsp" %>
<inquiry:tableClaimHistory numberOfRecords="<%="" + ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/><%= "" + ic.getTotalNumOfRecords %> is the cop-out way to convert an int to a String :-) -
Hi
I have this JSP , where I make use of interface Enumeration
There is no import statement in JSP for Enumeration. It gives me an error in
my IDE (wsad) and this JSP does not run inside WSAD.
If I deploy this JSP in weblogic it works without a problem
How does this work in weblogic .
Please advise
JSP is given below
<html>
<head>
</head>
<%
boolean isExpire = false;
System.err.println("Beginning of JSP");
if(request.getParameter("action")!=null){
System.err.println("before calling clean session");
cleanSession(session);
System.err.println("after calling clean session");
if (request.getParameter("action").trim().equalsIgnoreCase("expire"))
isExpire = true;
System.out.println("........isExprire:"+ isExpire);
String submit = request.getParameter("submit.x");
%>
<body onLoad="return setFocusOn();" bgcolor="#FFFFFF" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0" vlink="#666666">
<center>
<table>
<tr> <td colspan=4 ><br><br><br><center>
<form action ="logon.jsp" name="myform" method="post" >
<table width="300" border="0" cellspacing="0" cellpadding="0" >
<tr ><td colspan=2> </td></tr>
<tr><td colspan=2><br><br></td></tr>
<tr><Td align=right><div class=labeling>WwProbUser ID : </div></td><td>
<input name="userName" class="nav-input" type=text maxlength=10></td></tr>
<tr><Td align=right><div class=labeling>Password : </div></td><td>
<input name="password" type=password class="nav-input" maxlength=10></td></tr>
<tr><td colspan=2><br></td></tr>
<tr><Td colspan=2 align=center><input type="submit" name="submit" border=0
><br><br></td></tr>
<tr ><td colspan=2><br></td></tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
<%!
private void cleanSession(HttpSession session){
Enumeration en = session.getAttributeNames();
System.err.println("Enumeration is "+ en.toString() +" "+en.getClass());
String session_name = null;
while (en.hasMoreElements()){
session_name = (String)en.nextElement();
if (session.getAttribute(session_name)!=null) session.removeAttribute(session_name);
%>
Just compile a simple jsp page which doesnt have any import page directives
with weblogic.jspc
java weblogic.jspc -keepgenerated simple.jsp
The generated java files will have the imports implicitly imported by wls
"ks" <[email protected]> wrote in message
news:[email protected]...
>
> Nagesh
>
> Thanks for the answer ,
>
> Did that include java.io.* also , becuase this happens for the
IoException classes
> also,
>
> Where can we get a list of import statements like this which should not
be declared
>
> Thanks again
>
>
>
> "Nagesh Susarla" <[email protected]> wrote:
> >Weblogic's default import list includes "java.util.*" and thats the
reason
> >Enumeration works w/o the need for adding an explicit import to
java.util.
> >
> >--Nagesh
> >
> >"ks" <[email protected]> wrote in message
> >news:[email protected]...
> >>
> >> Hi
> >>
> >> I have this JSP , where I make use of interface Enumeration
> >>
> >> There is no import statement in JSP for Enumeration. It gives me an
> >error
> >in
> >> my IDE (wsad) and this JSP does not run inside WSAD.
> >>
> >> If I deploy this JSP in weblogic it works without a problem
> >>
> >> How does this work in weblogic .
> >>
> >> Please advise
> >>
> >> JSP is given below
> >>
> >> <html>
> >> <head>
> >> </head>
> >> <%
> >>
> >> boolean isExpire = false;
> >> System.err.println("Beginning of JSP");
> >> if(request.getParameter("action")!=null){
> >> System.err.println("before calling clean session");
> >> cleanSession(session);
> >> System.err.println("after calling clean session");
> >> if (request.getParameter("action").trim().equalsIgnoreCase("expire"))
> >> isExpire = true;
> >> }
> >> System.out.println("........isExprire:"+ isExpire);
> >> String submit = request.getParameter("submit.x");
> >>
> >>
> >> %>
> >> <body onLoad="return setFocusOn();" bgcolor="#FFFFFF" leftmargin="0"
> >topmargin="0"
> >> marginwidth="0" marginheight="0" vlink="#666666">
> >> <center>
> >> <table>
> >> <tr> <td colspan=4 ><br><br><br><center>
> >> <form action ="logon.jsp" name="myform" method="post" >
> >> <table width="300" border="0" cellspacing="0" cellpadding="0" >
> >> <tr ><td colspan=2> </td></tr>
> >> <tr><td colspan=2><br><br></td></tr>
> >> <tr><Td align=right><div class=labeling>WwProbUser ID :
> > </div></td><td>
> >>
> >> <input name="userName" class="nav-input" type=text
> >maxlength=10></td></tr>
> >> <tr><Td align=right><div class=labeling>Password : </div></td><td>
> >> <input name="password" type=password class="nav-input"
> >maxlength=10></td></tr>
> >> <tr><td colspan=2><br></td></tr>
> >> <tr><Td colspan=2 align=center><input type="submit" name="submit"
> >border=0
> >> ><br><br></td></tr>
> >> <tr ><td colspan=2><br></td></tr>
> >> </table>
> >> </form>
> >> </td>
> >> </tr>
> >> </table>
> >> </center>
> >> </body>
> >> </html>
> >> <%!
> >> private void cleanSession(HttpSession session){
> >> Enumeration en = session.getAttributeNames();
> >> System.err.println("Enumeration is "+ en.toString() +"
"+en.getClass());
> >> String session_name = null;
> >> while (en.hasMoreElements()){
> >> session_name = (String)en.nextElement();
> >> if (session.getAttribute(session_name)!=null)
> >session.removeAttribute(session_name);
> >>
> >> }
> >> }
> >> %>
> >>
> >
> >
>
Maybe you are looking for
-
After downloading latest iTunes 12 I cant open iTunes window says not installed correctly please re- install error 7 ( windows 5 ) PLEASE HELP
-
PI 7.31 SP14: use of MessageTransformBean Complex conversion w/o KEY values
In a mail sender channel I need to pick up a csv file with 2 (different) header lines and a number of data lines. the structure is like this: header1 header2 line line line There are no Key values in the file that I can use and no fixed lengths eithe
-
Business case to move from Oracle BPM 10.3g to BPM11g
We are a very large organisation doing our business process implementation using Oracle BPM 10.3g. Currently we are working on only 3 processes, but over next couple of years, we would have at least 10 LIVE processes. As an organisation, we are wonde
-
Once I view download a film from iCloud to view on my iPad, how do I return it to the cloud?
-
The reason why this is, is because you either have the "change sounds with buttons" setting ON or, you have installed either a faulty version of iOS 6.1 or a version which has an extremely massive bug in it. You can, however, get it out of headphone