Re: Custom tags and scope
Hi, I do not have a lot of experience in programming custom tags. Now, having programmed a couple of tags, I think it is kind of strage that I cannot narrow the scope of variables defined in the taghandler down to the body of the custom tag. It would for me clearly gain the purpose of code usability if so was the case. I hope I have missed something and that there may is a way to configure the tld file so that the scope of variables is restricted to the body. snip/ javax.servlet.jsp.tagext.TagExtraInfo#getVariableInfo(TagData) -Rahul Here is the code to clarify what i mean: TAGHANDLER (shortened for readability): Public void doTag() extends JpsExtension{ PageContext pc = (PageContext)getJspContext(); JspFragment body = getJspBody(); pc.SetAttribute(testvar, myvalue); body.invoke(null); } JSP (shortend for readability): htmlheadtitletest/title/head my:testtag${testvar}/my:testtag !-- now, this should be out of the scope, but it isnt: -- ${testvar} /html I do not want to specify or declare the variable first in the jsp. I also think that using an attribute to hold the name of the variable used is a bad idea. I absolutely want to use EL. Is there any hope, or do I have to live with it? Would appreciate any tips and workarounds Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.9 and JSP 2.0 runtime expressions in the attribute values of JSTL 1.1
On 9/13/05, Seva Popov [EMAIL PROTECTED] wrote: BTW, I understand that I can use a different syntax with the runtime expressions. So, if I change my jsp (not use the xml syntax) it's working fine: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fmt uri=http://java.sun.com/jsp/jstl/fmt; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % jsp:directive.page contentType=text/html; charset=UTF-8/ c:set var=aheader value='%=System.getProperty(com.tv.common.assets.header)%'/ ${aheader} However, I'd like to find out if it anyway somehow possible to use the jsp xml syntax and JSP 2.0 runtime expressions in the attribute values of JSTL 1.1 For example Resin does allow it. Any ideas? snip/ Funny you should ask [ http://marc.theaimsgroup.com/?l=tomcat-userm=112493628101874w=2 ] -Rahul -Original Message- From: Seva Popov [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 12:59 PM To: Tomcat Users List Subject: Tomcat 5.5.9 and JSP 2.0 runtime expressions in the attribute values of JSTL 1.1 Hi, I need to use the JSP 2.0 runtime expressions in the attribute values of JSTL 1.1 tags but I am getting the exception when I try to use them. My jsp page: jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:c=http://java.sun.com/jsp/jstl/core; xmlns:fmt=http://java.sun.com/jsp/jstl/fmt; xmlns:fn=http://java.sun.com/jsp/jstl/functions; version=2.0 jsp:directive.page contentType=text/html; charset=UTF-8/ c:set var=aheader value='%=System.getProperty(com.tv.common.assets.header)%'/ ${aheader} /jsp:root org.apache.jasper.JasperException: /test10.jsp(9,31) The value of attribute value associated with an element type c:set must not contain the '' character. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :405) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :86) org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.jav a:211) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:196) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 100) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Any advice? Thanks, Seva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException using jsp expression inside the c:set /
On 8/24/05, Seva Popov [EMAIL PROTECTED] wrote: Hi, The following line: c:set var=admin value=%=request.getParameter(admin)%/ gives me the below exception under Tomcat 5.5.9: org.apache.jasper.JasperException: /test.jsp(11,29) The value of attribute value associated with an element type c:set must not contain the '' character. Is this a bug in Tomcat or am I missing something? (I did not have any problems using the above syntax in Resin.) Not sure what the prefix c is bound to, but I'd use JSTL 1.1 with TC 5.5.x and use EL and the implicit JSP 2.0 param object like so: c:set var=admin value=${param.admin} / -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException using jsp expression inside the c:set /
On 8/24/05, Seva Popov [EMAIL PROTECTED] wrote: Hi Rahul, Thanks for pointing me to the implicit JSP 2.0 param object. This worked for me perfectly with the JSP 2.0 JSTL URIs: jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:c=http://java.sun.com/jsp/jstl/core; version=2.0 c:set var=admin value=${param.admin} / Anyway, I'd be interested to hear from somebody (with the pointers to the JSP or JSTL specs if possible) why c:set var=admin value=%=request.getParameter(admin)%/ worked for me with the latest Resin and doesn't with the latest Tomcat. Is it against the specs? snip/ You mean, apart from the fact that it is invalid XML and hence cannot be part of a jspx document (such as the one you are using)? ;-) -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException using jsp expression inside the c:set /
On 8/24/05, Seva Popov [EMAIL PROTECTED] wrote: Well, JSTL l.0 spec snip/ /JSTL l.0 spec As you see runtime expressions were quite valid in jstl 1.0 tags. snap/ They still are, but IMO in the JSP 2.0 XML syntax, it gets tricky to use them in attribute values. EL has taken over, and for good reason. So lets sprinkle some magic dust, bid the angle brackets bordering the expression adieu and hand you this to replace what you have in your JSP 2.0 document in XML syntax: c:set var=admin value='%=request.getParameter(admin)%'/ Might work, OTOH, we could also attempt to write readable code. Lest we miss the only combination of single and double quotes that will work in the attribute value ;-) I couldn't find information in jstl 1.1 / jsp 2.0 regarding this issue. That is why I would appreciated the pointers to the specs. snap/ I'm out of cycles for this, but read the chapter on JSP documents from the 2.0 spec, its either chapter 5 or 6. -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom tag runtime expression problem
On 8/18/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: Hi all, I'm using Tomcat 5.0.29. I've created a custom tag and I need to be able to use runtime expressions for certain attributes. But it isn't working and I'm beating my head on the desk trying to figure out why. Here's my TLD: ?xml version=1.0 encoding=UTF-8? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; snip/ I'd go with a 2.0 TLD since you're on TC 5.x. Is that possible? Plus you will get to use EL instead of JSP expressions in tag attribute values. -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] robots.txt
Marked OT. On 7/14/05, Eric J. Pastoor [EMAIL PROTECTED] wrote: The msn bot has been hammering one of my webapps for about 2 weeks now. I have a calendar style transaction page that is not password protected. Essentially this calendar goes on forever. This means that the msn bot is basically going on forever. It is making my log files insanely large. Is there a way to create a robots.txt file for basically one servlet instead of everything? In theory, yes, by using the disallow directive appropriately. For example, this snippet recommends all bots stay away from your CGI scripts. User-agent: * Disallow: /cgi-bin/ and this one recommends that badbot stays away from the GoodServlet User-agent: badbot Disallow: /servlets/GoodServlet -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CATALINA_BASE
On 7/12/05, Kenneth B. Harwood [EMAIL PROTECTED] wrote: snip/ is there a user-list SEARCH form anywhere or do i need to check the archives manually month-by-month? snap/ This is an option [ http://marc.theaimsgroup.com/?l=tomcat-userr=1w=2 ] -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1.37 and 5.0.2?? differences
From: Peter Crowther [EMAIL PROTECTED] snip/ From: Mark Benussi [mailto:[EMAIL PROTECTED] Subject: Tomcat 4.1.37 and 5.0.2?? differences snap/ Are Servlet filters supported Yes, on both, I believe. Additionally, after the move, you will be able to apply filters to RequestDispatcher includes and forwards as well. and more importantly what J2EE does it typically run on? Tomcat is a servlet container, not a full J2EE app server. 5.x.x implements the relevant bits in J2EE 1.4 -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CSJakharia: Difference between Tocmat 5.5.2 and Tomcat 4.1
On 7/8/05, Chirag [EMAIL PROTECTED] wrote: I am undergoing Project development in Tomcat 5.5.2 which has to be converted for another Client in Tomcat 4.1 but I have no idea regarding the improvements/Difference between Both the version and so am confused to say how much time would be required snip/ Seems to be a popular question today ;-) This thread may help [ http://marc.theaimsgroup.com/?l=tomcat-userm=112082335422569w=2 ] -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1.37 and 5.0.2?? differences
On 7/8/05, Mark Benussi [EMAIL PROTECTED] wrote: Thanks Rahul but in case it wasnt clear I am downgrading from 5 to 4. snip/ Oh, sure, its a two-way street. Then, the obvious statement to make would be, you'd be in a spot if your webapps rely on bits that are servlet 2.4 modulo servlet 2.3 or JSP 2.0 modulo JSP 1.2. The not-so obvious bit might be what that layer of frosting is. AFAIK, WRT sevlets its things such as applying filters to more than just the original request and lifecycle listeners, and WRT JSPs, things such as tag impls and container evaluation of EL expressions. Refer the specs for details. -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat with EL
I suspect you want to use JSP 2.0 (which allows EL expressions in template text). TC 5.0.x (or higher) implements the JSP 2.0 spec. Use a servlet 2.4 web app descriptor (web.xml) for your application and you should be set. -Rahul On 6/9/05, Marian Nedelescu [EMAIL PROTECTED] wrote: Hi, Could I use Tomcat with JSP that has expression language (EL) ? Thnak you in advance Marian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How could I specify in web.xml that use JSP 2.0
On 6/9/05, Marian Nedelescu [EMAIL PROTECTED] wrote: Hi Rahul, What must I write in my web.xml file to specify that I want to use JSP 2.0 ? snip/ Nothing, as long as its a servlet 2.4 web.xml, details in item 1 here [ http://wiki.apache.org/jakarta-taglibs/FrequentlyAskedQuestions ] -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat newbie : cant make a simple servlet work
On 6/4/05, Michael Echavez [EMAIL PROTECTED] wrote: Greetings everyone! I'm a newbie with Tomcat and i've already been trying out a simple server example for about 2 days now and still it wouldnt work. I really hope someone would help me out. snip/ !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;http://java.sun.com/dtd/web-app_2_3.dtd%22 Given you're using TC5.5.x, why not upgrade to servlet 2.4? The doctype appears malformed, but maybe that just a cut and paste side effect. display-namewileyapp/display-name description This is my first ever servlet and i hope it will finally work. Please Lord, make it work... /description We have a long way to go before that sort of thing works ;-) For now, see below: servlet servlet-nameSimpleServlet/servlet-name snip/ servlet-classchapter2.SimpleServlet/servlet-class !-- Load this servlet at server startup time -- load-on-startup5/load-on-startup /servlet I didn't see a servlet-mapping element. It maps the servlet to the url(s) that will invoke it. Add: servlet-mapping servlet-nameSimpleServlet/servlet-name url-pattern/SimpleServlet/url-pattern /servlet-mapping below the servlet element. Then, visit (reusing host port information): http:/localhost:8080/wileyapp/SimpleServlet -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts validation frame work
Not all validations can/should be done client-side. -Rahul On 5/24/05, raja buddha [EMAIL PROTECTED] wrote: Hi all In struts why do we need validation frame work we have java script to do validations. Is there any extra advantage of using the validation frame work Regards raj _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT: Good taglib repository - looking for date hadling tags
One such repository: http://jakarta.apache.org/taglibs/ -Rahul On 4/26/05, Nikola Milutinovic [EMAIL PROTECTED] wrote: Hi all. This is not exactly a Tomcat question, but since there are so many of us developers (and admins) around, I thought I ask. Is there a good repository of free JSP tag libraries for some common things, like date printing/formatting, table display, etc? When I say, date printing, I mean, if I have java.util.Timestamp, or even better, java.sql.Timstamp, I'd like a tag that can print that as a date or just time or a full timestamp. For tables, I think I saw somewhere a tag that could print a collection as atable with alternating style for rows, allowing you to format it with CSS. What are you guys using when you need to print a date from a timestamp? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: digester understanding again...
Depends how you designed your classes that the XML is digested into ;-) If you're looking for specific kinds of queries, then the class(es) should be geared to supporting those [aggregation, composition and keying constructs associated with the semantics of the data need to be reflected in the digested output]. If you don't do that, you might as well use a DOMParser and XPath / XQuery. -Rahul On 4/21/05, Henrique, Manuel [EMAIL PROTECTED] wrote: Hello all, Here I come again with my digester :)) So, I have my xml file, I have created my digester and all the needed classes for my xml tags, and do a digester.parse(). Still here all is ok. I start Tomcat 5.0 and look to the log file. All seems ok, my xml file is consumed, all the classes are instancied etc...etc... My question: If I have an xml file like this computer brand name=compcool modelfaster_than_all/model serialnumber1248965serialnumber /brand brand name=pcassociated modelvery_expensive/model serialnumber34564serialnumber /brand brand name=pcassociated modelexpensive_too/model serialnumber99serialnumber /brand /computer how can I get after in my Java code the serial number of the model expen sive_too for example??? How can I be sure to get the good data as I have two identical brand names? Thank you for your help. Regards, Manuel ps: I know that for someones the question seems to be very basic but remember when you were beginner and be kind to me This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Precompilation of tag files
Bernhard Slominski wrote: Hi, after getting the jsp precompilation finally working, I want also want to do the precompliation for tag files. JSP precompilation should also trigger precompilation for custom tags within the JSP. The precompilation task generates servlets and servlet mappings in the web.xml. The jasper2 task also creates the servlet and even the class file for the tag file. You can't be seeing a servlet. Its probably a final class implementing one of the tag interfaces in the javax.servlet.jsp.tagext package. But I don't see a chance to do the mapping to the compiled tag file servlet in the web.xml. Its not a servlet ;-) Theres no per tag mapping in web.xml -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException: Could not find ancestor parseTag ???
Would help if you posted appropriate snippet from v3getT1ClientV.jsp as well. -Rahul On Tue, 8 Mar 2005 11:07:04 +0100, Philippe Couas [EMAIL PROTECTED] wrote: Hi, I have folloing error message org.apache.jasper.JasperException: Could not find ancestor parseTag snip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting datasource in a JSP?
javax.naming.Context On Tue, 08 Mar 2005 09:32:19 -0500, Darryl Wagoner [EMAIL PROTECTED] wrote: snip I think the main problem is that I haven't found the import for the Context class. snap - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP/Servlet Mailing List?
For JSP authoring questions related to JSTL, custom tag libraries (especially those supported by jakarta taglibs), you can post to [EMAIL PROTECTED] If your questions are Jasper or TC deployment specific, you're better off staying here ;-) -Rahul On Mon, 7 Mar 2005 07:56:23 -0500, Anderson, M. Paul [EMAIL PROTECTED] wrote: Does anyone know of a good JSP/Servlet mailing list/help list that is both active and similar in format to this group? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jsp mapping
This example explains as to make mapping filter on servlet: snip How to make mapping with JSP ? Have you tried url-pattern? (instead of servlet-name in the filter mapping) Since I'm all for precompilation, I don't see JSPs differently ;-) http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Volunteers for translation
Tomcat users - The web is becoming multi-channel. Are you interested in knowing how speech applications are authored? Are you good at translating from English to another language? If so, this might be a good volunteer opportunity to contribute to a fledging jakarta taglibs sandbox tag library. I'm working on the Reusable Dialog Components (RDC) tag library listed here: http://jakarta.apache.org/taglibs/sandbox/doc/rdc-doc/intro.html As we begin to work on internationalization for the RDC taglib, we are looking for help in translating a set of speech grammars we have (written in English) to other languages. You don't need to know the grammar syntax, you will pick it up along the way. If you want to take a look at the grammars, you can download the jakarta taglibs sandbox source available here: http://jakarta.apache.org/builds/jakarta-taglibs-sandbox/nightly/src/ and go to: jakarta-taglibs-sandbox-src/rdc/src/.grammar/ If interested, please send me an email (probably off the list, but I leave that to you). You will receive credit according to the usual norm for translators. -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]