Re: Custom Tags

2003-08-14 Thread David M. Karr
 Vijith == Vijith  [EMAIL PROTECTED] writes:

Vijith Hi All,
Vijith Is there anyway in which I can prevent the body inside a custom tag from
Vijith appearing in the output.

Vijith ie

Vijith emptag
Vijith this is the text
Vijith /emptag

Vijith Now i donot want this is the text to appear in the output

Vijith but i want to get this text in the Custom Tag Handler and then modify it
Vijith and tehn put it back to the body

Vijith I would like to get it as

Vijith Thisbrisbrthe brtext

Read almost any reference about building JSP custom tags.  You'll find that a
tag class extending BodyTag can call getString() on the body content, massage
the value, and then use the getPreviousOut() method on the tag handler to get
the writer to write the output to.  You can get a brief summary of this in the
JSP tutorial on the Sun web site.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com


Re: Problem Subclassing Tag

2003-04-12 Thread David M. Karr
 Adam == Adam Sherman [EMAIL PROTECTED] writes:

Adam I'm getting:
Adam JasperException: No getter method for property name of bean
Adam org.apache.struts.taglib.html.BEAN

Adam My tag is actually a subclass of org.apache.struts.taglib.html.OptionsTag.

Adam I don't mess with the name property or define it in my tld. (My tag sets
Adam up the parent tag without any parameters.)

Adam So, first, what is BEAN?

Adam And, second, what is causing my error?

You'd have better luck asking this on the struts-user list.

The value of org.apache.struts.taglib.html.BEAN is what is used if the name
attribute is not specified.  As the documentation for the options tags says,
if you don't specify it, it will use the name of the ActionForm bean specified
in your form tag.

The error message states there is no name property on the specified bean.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com


Re: Referencing constants in EL

2003-03-29 Thread David M. Karr
 Adam == Adam Sherman [EMAIL PROTECTED] writes:

Adam How can I use the Expression Language to reference constants like
Adam Application.CONSTANT Strings and the like?

This has been asked numerous times, probably just as often on the taglibs-user
list as on this list.

The EL references JavaBeans properties, Collections, and Maps.  That's it.  If
you want to reference static variables, you'll have to convert them to a form
that the EL can reference.

One portable strategy would be to build a class that when instantiated, takes
another class, and it uses reflection to store all the static variables defined
in that class into a map, where the keys are the variable names and the values
are the variable values.  You can then reference that map from the EL.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com


Re: Urgent, Making taglib available to JSPs without those being in a WAR

2002-11-30 Thread David M. Karr
 Paul == Paul Copeland [EMAIL PROTECTED] writes:

Paul David -
Paul OK, I'm game. This just went WAY over my head. Why can't he have a
Paul web.xml without a WAR? ;-)

Ok, this is splitting hairs, but I suppose you could build a directory
structure that matches the WAR structure without building a WAR file.  If you
did that, however, I don't see the point of not building a WAR file.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Mapping custom tag attributes to setters with different names?

2002-10-12 Thread David M. Karr
Is it possible to have a custom tag have an attribute that gets mapped to a
getter/setter pair which doesn't match the attribute's name wrt the JavaBeans
specification?

For instance, normally an attribute named dispatch would get mapped to
getDispatch() and setDispatch().  However, I need to have it map to
getDispatchExpr() and setDispatchExpr().

I need this because my tag is deriving from a base class tag which uses the
same attribute, but which is mapped to a getter/setter pair which
returns/expects a boolean, instead of a string.  My derived class needs to use
a string, not a boolean.  This is why I've defined getDispatchExpr() and
setDispatchExpr().

I was under the impression that this is what a BeanInfo class is for.  It
appears, however, the use of this class is just a convention, for IDEs which
follow the JavaBeans specification, and that normal JavaBeans introspection
doesn't use them.  In my test case, my BeanInfo class appears to be ignored.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Mapping custom tag attributes to setters with different names?

2002-10-12 Thread David M. Karr
 Hans == Hans Bergsten [EMAIL PROTECTED] writes:

Hans BeanInfo classes are used by the JavaBeans introspector so it should
Hans work. You may some ideas from the PropertyEditors for custom string
Hans literal conversion section in this article I wrote for ONJava.com:

Hanshttp://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html

Hans It deals with using a BeanInfo class to associate PropertyEditors with
Hans a custom action attribute, but the basics are the same.

I must have something wrong at a high level then.  I put a print statement at
the top of my BeanInfo's getPropertyDescriptors method.  I never see it.

My two classes have the following package path:

org.apache.strutsel.taglib.html.ELHtmlTag
org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo

I'm using Tomcat 4.1.10 on Win2k.

I've verified both classes are in my WAR file.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Mapping custom tag attributes to setters with different names?

2002-10-12 Thread David M. Karr
 David == David M Karr [EMAIL PROTECTED] writes:

 Hans == Hans Bergsten [EMAIL PROTECTED] writes:
Hans BeanInfo classes are used by the JavaBeans introspector so it should
Hans work. You may some ideas from the PropertyEditors for custom string
Hans literal conversion section in this article I wrote for ONJava.com:

Hans http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html

Hans It deals with using a BeanInfo class to associate PropertyEditors with
Hans a custom action attribute, but the basics are the same.

David I must have something wrong at a high level then.  I put a print statement 
at
David the top of my BeanInfo's getPropertyDescriptors method.  I never see it.

David My two classes have the following package path:

David org.apache.strutsel.taglib.html.ELHtmlTag
David org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo

David I'm using Tomcat 4.1.10 on Win2k.

David I've verified both classes are in my WAR file.

Well, for some reason, I'm now seeing the method being executed.  I'm not sure
why it didn't appear to be executed before.

However, what I'm trying to do with this isn't quite working yet.  I'll have to
look at this a bit and perhaps ask about this again.  My property is a boolean
property, but I have to pass the string value through the JSTL EL.  I have to
think about exactly how that needs to happen.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Mapping custom tag attributes to setters with different names?

2002-10-12 Thread David M. Karr
 Hans == Hans Bergsten [EMAIL PROTECTED] writes:

Hans David M. Karr wrote:
 Hans == Hans Bergsten [EMAIL PROTECTED] writes:


Hans BeanInfo classes are used by the JavaBeans introspector so it should
Hans work. You may some ideas from the PropertyEditors for custom string
Hans literal conversion section in this article I wrote for ONJava.com:

Hans http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html

Hans It deals with using a BeanInfo class to associate PropertyEditors with
Hans a custom action attribute, but the basics are the same.

 I must have something wrong at a high level then.  I put a print statement at
 the top of my BeanInfo's getPropertyDescriptors method.  I never see it.

 My two classes have the following package path:

 org.apache.strutsel.taglib.html.ELHtmlTag
 org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo

 I'm using Tomcat 4.1.10 on Win2k.

 I've verified both classes are in my WAR file.

Hans It _may_ be a TC 4.1.x bug; I tested the example in the article with
Hans TC 4.0.x way back when I wrote the article and have not tested it with
Hans the TC 4.1.x versions. You may want to test with 4.0.x as well to find
Hans out.

What looks like is happening is that if I redeploy an application, adding a
BeanInfo class, it seems to ignore the BeanInfo class.  If I then recycle the
server and deploy the application, it works fine.  After the BeanInfo class is
deployed for the first time, I can change the BeanInfo class and redeploy it,
and it sees the changes.  I have a bunch more of these to add, so I'll get
enough opportunity to test this theory.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Q: Separation of layout and code (similar to Visual Studio.net)?

2002-07-24 Thread David M. Karr

 Martin == Martin Yager [EMAIL PROTECTED] writes:

Martin --- Ola Theander [EMAIL PROTECTED] wrote:
 Dear subscribers.

 I would like to know if there is some JSP engine,
 class library or
 similar that allows the Java code to be separated
 from the layout, i.e.
 HTML code, similar to what's available in MS Visual
 Studio.net?

 In VS.net a dynamic web page is built by two
 separate files, one file
 containing the layout of the page and one page
 containing the code. The
 code manages the objects in the layout file, e.g. a
 text box, list box
 etc. as objects with properties and methods, pretty
 much as if you where
 coding a GUI application. There is also the
 possibility to build more
 complex object composed by existing objects and
 HTML. The big advantage
 is that you as the developer will have an
 abstraction layer between the
 code and the layout and the graphics designer
 doesn't need to worry
 about the code.

 My question is, is there something similar to this
 on the
 JSP/Servlet/J2EE platform?

This is provided by the Tiles package, as part of the Jakarta Struts framework.
You can define layouts with specific HTML layouts, and definitions, which
reference the layouts.  You can even define all the definitions (the actual
page instances) in a single file.

Then, using Struts, you can define all the display strings in a resource file,
so your JSP code doesn't hardcode any strings.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: JSP testing tool

2002-07-22 Thread David M. Karr

 Mohan == Mohan kumar Gowri sankar [EMAIL PROTECTED] writes:

Mohan Hi,
Mohan Is there any JSP testing tool out there in market?.

There are several open-source tools that you could combine to build unit tests
for JSP code.

The combination of Tomcat, JUnit, Cactus, HTTPUnit, JTidy, and Xalan should
give you everything you need.  Using Tomcat, Junit, Cactus, and HTTPUnit, you
can get JSP output in unit tests, and JTidy (used under the covers by HTTPUnit)
and Xalan will allow you to validate that output.

For a simple (maybe) example of how some of these are put together, look at the
source distribution of the Struts package, and how the unit tests are
constructed.  They don't have good examples of using HTTPUnit, JTidy, and
Xalan, but this will get you further down that road.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Using JNDI in a JSP/Servlet

2002-01-26 Thread David M. Karr

 Celeste == Celeste Haseltine Haseltine writes:

Celeste David,
Celeste I think I am a little confused.  Someone else on this list suggested that 
I
Celeste go back to my JDBC driver vendor, and/or my JSP/Servlet vendor and find 
out
Celeste what jar file their implementation of JNDI was located in, and to get 
advice
Celeste on how to set properties and obtain a new Initial Context.  I did get a
Celeste reply from my JDBC vendor, who indicated that their sample file used the
Celeste com.sun.jndi.fscontext.RefFSContextFactory by default, since this was
Celeste included in the Sun JDK.  Since I could not get either the Java class or 
my
Celeste Servlet file working, I suspect that I don't have something set up on my 
dev
Celeste box properly, perhaps the fscontext jar file, as you suggested.  But my
Celeste intent is to actually use JNDI in a servlet.  My driver vendor suggested
Celeste that if I wanted to use JNDI inside my JSP/servlet server environment, I
Celeste would need to contact the vendor of my servlet server (Allaire in this 
case)
Celeste and find out what jar file and API they had for setting properties and
Celeste creating a new Initial Context.  I am still waiting to here back from
Celeste Allaire.  Am I on the right track here, or am I completely missing
Celeste something???

As I said, if you want to use the RefFSContextFactory class in the sample
file system JNDI provider, you have to have it.  It's in the fscontext.jar
file you can get from
http://java.sun.com/products/jndi/serviceproviders.html.  It's NOT in the
JDK.

Just in case you're misunderstanding something, this class you're looking for
implements a sample JNDI provider for querying files on the local file system.
It's not something you would normally use in an application (unless you really
needed that capability).

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Using JNDI in a JSP/Servlet

2002-01-18 Thread David M. Karr

 Celeste == Celeste Haseltine Haseltine writes:

Celeste I'm attempting to use JNDI with a third party JDBC driver inside of a
Celeste servlet.  When I attempt to call the servlet, my catch block catches the
Celeste following error message:

Celeste Error .   Cannot instantiate class:
Celeste com.sun.jndi.fscontext.RefFSContextFactory

Celeste I moved the code into a pure Java class for debugging.  The line that the
Celeste error message occurs on is as follows:

Celestectx = new InitialContext(env);

Celeste Does anyone have a guess as to why I am unable to instantiate a new 
Context
Celeste class?  I suspect it may have to do with setting permissions for jndi, 
but I
Celeste am not certain.  I do have the JNDI.jar file in my server jvm jre\lib\ext
Celeste subdirectory, and I moved it into my jdk jre\lib\ext subdirectory for
Celeste debugging the class code.  Just for grins I included the jdk jre\lib\ext
Celeste path in  my dev box classpath for testing the class code.  The class code 
is
Celeste as follows:

Ordinarily, I would assume this is a silly question, but did you make the jar
file which contains the com.sun.jndi.fscontext.RefFSContextFactory class
available to the application?  This particular class (as I recognize it) should
be in the fscontext.jar that is part of the File System sample JNDI service
provider that you can get from
http://java.sun.com/products/jndi/serviceproviders.html.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: No Cache on JSP Page

2001-08-04 Thread David M. Karr

 Josh == Josh Pepper Pepper writes:

Josh Hey, all.
JoshTrying to prevent a login page from caching, and the usual meta-tags
Josh don't seem to be working. Anyone have any thoughts on this?

Other people may have different information, but from what I've read (I haven't
personally tested this), using meta tags to prevent caching is unreliable.
You're better off using headers to specify this.  You can set these directly in
the JSP page.

In particular (I think these are correct), specify Pragma: no-cache for HTTP
1.0 support, and Cache-Control: max-age=0 for HTTP 1.1 support.

--
===
David M. Karr  ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: IE5 and cached jsp pages?

2001-05-23 Thread David M. Karr

 ruaidhri == ruaidhri fernandes Ruaidhr writes:

ruaidhri Hi all, Sorry for sending in this question again but nothing I
ruaidhri try is working. I've tried setting the response headers to
ruaidhri control the cache and Ive tried setting the meta eqiv tags but I
ruaidhri still have my problem.  When the user hits the back button the
ruaidhri previous pages is still there, I'm assuming its coming from the
ruaidhri cache.  I read IE5 has a few problems but I can't resolve them
ruaidhri with the fixes. If anyone has ever resovled a problem similar to
ruaidhri this could they let me know how they did it?  Thanks Rui

When you say you tried setting the response headers, do you mean you had
something like this?:

  Cache-Control: max-age=0

--
===
David M. Karr  ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Using a jsp:include action (JSP 1.1) within a BodyTag taglib tag

2001-01-30 Thread David M. Karr

 "Alex" == Alex Tang [EMAIL PROTECTED] writes:
  Alex hi folks.  (Sorry for the wide distribution, this question seems to span
  Alex both the JSP and taglib realm).

  Alex I'm having a problem with the interaction of a taglib BodyTag and a
  Alex jsp:include action (or an equivalent taglib tag that uses a
  Alex pageContext.forward()).  For example, if I have:

  Alex  foo:myBodyTag
  AlexBlah Blah...
  Alexjsp:include page="..."/
  Alex  /foo:myBodyTag

  Alex The output from the jsp:include action always appears BEFORE the output
  Alex from the myBodyTag taglib tag.

  Alex (BTW, I'm using Tomcat 3.1)

I'm just a lurker, but I belive this is one of the advantages of the
Struts framework.  The "struts:include" tag deals properly with
nesting situations.

(and I'm sure someone will point out to you that you should be
upgrading to Tomcat 3.2.1, as 3.1 has numerous damaging bugs.)

--
=======
David M. Karr ; w:(425)487-8312 ; TCSI  Best Consulting
[EMAIL PROTECTED]; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Drawing pie chart in jsp

2000-12-29 Thread David M. Karr

 "Murthy" == Murthy B V S N [EMAIL PROTECTED] writes:
  Murthy not only pie charts ..
  Murthy i want to show the growth ... related to a statistical data.
  Murthy it is very easy to understand from charts than the huge table.
  Murthy can any one suggest drawing charts dynamiclally .. from table of data
  Murthy without using applets.

First of all, you need a package that can generate charts.  I haven't
used it, but I've noticed that "JFreeChart" appears to be actively
developed, and is open source (LGPL).  You can get it from
http://jrefinery.com/jfreechart/.

Then, you'll need code on the server side which will use JFreeChart
togenerate these charts into GIFs (I assume JFreeChart can facilitate
this), and you then incorporate these into the HTML pages that your
JSPs generate.

--
=======
David M. Karr ; w:(425)487-8312 ; TCSI  Best Consulting
[EMAIL PROTECTED]; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: How can I print a HTML page using PrintAPI without using Graphics object !

2000-11-20 Thread David M. Karr

 "Bhuvaneswari" == Bhuvaneswari Palanivel [EMAIL PROTECTED] 
writes:
  Bhuvaneswari Hi,

  Bhuvaneswari For my application, we need to print many HTML pages. How can i print 
HTML
  Bhuvaneswari pages without using the Graphics object? Actually in java 1.2 contains
  Bhuvaneswari Printing  API. But the interfaces and classes are used for painting 
images
  Bhuvaneswari and text.

  Bhuvaneswari Please give some information regarding on this.
  Bhuvaneswari If possible, some sample code.

If you load your HTML into a JEditorPane, it knows how to render it on
the screen.  You can derive a class from JEditorPane that implements
Printable, and add a "print" method, which will just call "paint()",
sending the Graphics2D object.  Other details, like scaling, are
relevant, but are just fine-tuning compared to getting the page to
print at all.

I've done this with a JEditorPane I display on the screen.  It's
entirely possible you could get this to work without rendering it on
the screen.

Trying to print multiple HTML pages like this (in an unattended
fashion) might be difficult.  I'm not sure what issues might surface.

--
=======
David M. Karr ; [EMAIL PROTECTED]  ; w:(425)487-8312 ; TCSI  Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Servlet/JSP Development

2000-10-23 Thread David M. Karr

 "Antonio" == Antonio W Lagnada [EMAIL PROTECTED] writes:
  Antonio I do have this set to "true" in the server.xml config file and it's still
  Antonio not reloading:

  Antonio Context path="/bxu" docBase="webapps/bxu" debug="0" reloadble="true"
  Antonio /Context

If you entered this exactly as from the file, then changing
"reloadble" to "reloadable" might help.

--
=======
David M. Karr ; [EMAIL PROTECTED]  ; w:(425)487-8312 ; TCSI  Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: invoke excel/word from jsp/servlet

2000-09-11 Thread David M. Karr

 "hua" == hua ge [EMAIL PROTECTED] writes:
  hua Hi,
  hua I have a html search result page (done in jsp/servlet) containing lines of
  hua found records.

  hua our client like to set up a save button on this page and it will invoke word
  hua or excel window which will contain all the result data in Text(tab delimited
  hua .txt) format or in CSV(Comma delimited .csv). then they can save as the
  hua files to their local disk.

  hua can someone share some idea or offering some sample code to implement this
  hua kind of application?

  hua I assume I can set ContextType to some MIME type to invoke excel or word,
  hua but how the data in the page can be transfored to the excel or word in a
  hua certain format? I need detailed help.

The text format for excel is very simple.  Each field is separated by
a tab, and each line is separated by a newline.

If the contentType is "application/vnd.ms-excel", then the browser
will interpret it as an excel document, on Windows, at least.  With
IE, it puts it in the browser window, and in netscape, it has to open
a separate Excel window (unless there is some way to integrate it into
the browser window, which I'm not familiar with).

So your operation could execute a servlet which would just set the
contentType, and output the data in tab-delimited format.

For an example, pick up the book "Core Servlets and JavaServer Pages",
and look at page 254, for the section "Generating Excel Spreadsheets".

--
=======
David M. Karr ; [EMAIL PROTECTED]  ; w:(425)487-8312 ; TCSI  Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Reference to Model 2 design pattern article?

2000-06-15 Thread David M. Karr

I really have looked for this, and I believe I saw it at one time, but
I'm unable to find it now.  I'm looking for a reference to a detailed
description of "Model 2", the "modern" way of structuring a
JSP/Servlet application.

--
=======
David M. Karr ; [EMAIL PROTECTED]  ; w:(425)487-8312 ; TCSI  Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (6/12/2000)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets