Hi,
I am using Jstl and I also have some own tags. The out put of my
tags are some variables. Which one of these methods is best to expose
these variables
1. To give them as TEI variables in a separate class
2. Use them directly in the jsp page using the
I am interested in knowing which
Thank you
I am using struts, and am relatively new to java, I have never dealt with a
map??, and don't know what JSTL is, but I am reading up on it now. If there
is a resource that shows something like this it would be appreciated.
-Original Message-
From: Eric W Hauser [mailto:[EMAIL PR
That's an odd little wrinkle to the EL ;-). For a test, I put together a
JSP:
<%@ page contentType="text/plain" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%
map.put(new Integer(1), "One");
map.put(new Integer(2), "Two");
map.put(new Integer(3), "Three");
pageContext.setAt
i'm guessing that you are using Struts...so, why don't you just get those
fields out of the database in an Action class and set them as a request
attribute? maybe you could store them in a Map with constants in your JSP
as your keys and then use JSTL to retreive those values? If you're doing
that,
I am working on a project that requires many list boxes to be populated from
a database.
I have done a lot of readying on this and managed to create a taglib that
will get my database fields and put it into a dropdown list, but I have to
use Form Beans for validation, which I could not figure out
Thanks Serge. Your suggestion works great with one caveat:
I can't specify delims="\r\n" because those values are used literally.
However, this seems to work:
<% String newline = "\r\n"; pageContext.setAttribute("newline",
newline); %>
-Original Message-
From: Serge Knystautas [mailto:
I believe you can do (with reportID a variable containing the key)
<:set var="laborReport" value='${mapOfLaborReports[reportID]}'/>
which is very different from (with "reportID" as the key)
<:set var="laborReport" value='${mapOfLaborReports["reportID"]}'/>
so to use 3 as a key
nick
On 16 Jul 2
There is probably a real easy answer for these two questions, but I
searching the archives for a while hasn't helped...
1) I have beans in a map that are stored with integers for the keys.
For testing I can retrive the bean out fine with the key of "test" like:
But if I try this with...
I g
[EMAIL PROTECTED] wrote:
Im trying to find out if there are any string manipulation functions in
jstl because im tryong to truncate a sentence for example i want to only
display the first 10 characters of a sentence.
Im looking for something that would allow me to do something like
JSP 2.0 introdu
Check out the string taglibs.
http://jakarta.apache.org/taglibs/doc/string-doc/intro.html
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
07/16/2003 04:30 PM
Please respond to
"Tag Libraries Users List" <[EMAIL PROTECTED]>
To
[EMAIL PROTECTED]
cc
Subject
truncating text with JSTL
Im trying
Im trying to find out if there are any string manipulation functions in
jstl because im tryong to truncate a sentence for example i want to only
display the first 10 characters of a sentence.
Im looking for something that would allow me to do something like
--
Or something bean-based might work. Not sure if it's any better than writing a tag.
ExceptionBean.java:
---
package foo;
import java.io.*;
public class ExceptionBean implements Serializable {
private Throwable t;
public Throwable getThrowable() { return this.t; }
pub
There is currently no way to do that using JSP 1.x because it will not allow
method calling (including passing parameters) using EL.
However, this will change in JSP 2 as this will be supported.
So for now I guess your stuck with using a scriptlet or creating a simple
tag to do this.
-Tim
-Or
When I did this, I used option #1. I kind of extended a controller tag I
had already built to do the work of replacing the "\n"s with ""s and
so on.
James Smith
Application Systems Analyst, Treistman Center
College of Fine Arts, University of Arizona
- Original Message -
From: "Brian Da
Brian Dame wrote:
Does anyone have tips on preserving line breaks in ?
For example, a user enters text into a textarea, which is stored in a
database. When I retrieve the text from the database, I'd like to
display it formatted exactly as the user entered it.
I can only think of two options:
1) P
Does anyone have tips on preserving line breaks in ?
For example, a user enters text into a textarea, which is stored in a
database. When I retrieve the text from the database, I'd like to
display it formatted exactly as the user entered it.
I can only think of two options:
1) Parse the text, in
Thanks Matt, that does help me out!
-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 10:54 AM
To: Tag Libraries Users List
Subject: Re: Can't find struts DynaActionForm property with JSTL
Your syntax for is correct using ActionForms, but f
NP, it's a relatively far away hidden comment in the servlet spec, which cost me quite
a bit of time to find as well. Glad to have been of help.
Martin
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: woensdag 16 juli 2003 16:53
> To: Tag Libraries Users List
Your syntax for is correct using ActionForms, but for
DynaActionForms you need to do this:
Matt
- Original Message -
From: "Helen Ge" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 16, 2003 10:50 AM
Subject: Can't find struts DynaActionForm property with JSTL
> Hi,
I'm not sure there's a good way to do this in JSTL, but thanks to your help
Martin, I was able to get the stack trace to print in JSP, which I've tried
to do many times over the last couple years! The code looks like this:
<%
Exception exception =
((Exception)request.getAttribute("javax.servlet.e
Hi,
I am using Struts DynaActionForm object dataForm (session scope) to hold a
form data. It is no problem to display that form bean property in the JSP
page by using the Struts bean tag .
However I'd like see how the JSTL works by using JSTL without specifying
scope , it gave me exception like
Erm,
Not really experienced enough with JSTL yet for that. What you're currently getting is
the exception.toString(). For the full stacktrace you'd need to do:
<%
((Exception)request.getAttribute("javax.servlet.error.exception")).printStackTrace(response.getWriter());
%>
How to express that in
Martin,
That worked, but I only see the first line of the stacktrace. Anyway to get
the entire stacktrace?
This is what I currently have:
Thanks,
jb
-Original Message-
From: Martin van Dijken [mailto:[EMAIL PROTECTED]
Sent: Wed 7/16/2003 10:07 AM
Hey Jeff,
The exception is available as a parameter in the request attributes under
"javax.servlet.error.exception".
Martin
> -Original Message-
> From: Jeff Born [mailto:[EMAIL PROTECTED]
> Sent: woensdag 16 juli 2003 16:08
> To: Tag Libraries Users List
> Subject: RE: Exception var -
I would like to have an error page that handles exceptions that flows the
site I'm developing. In order to do this I would like to replace the Tomcat
generated page with a jsp:
java.lang.Throwable
/jsp/error.jsp
Then in the error.jsp have a line like :
However nothing prints
25 matches
Mail list logo