Re: JSTL XML and multibyte characters

2004-07-18 Thread Mark R. Diggory
You might explore the issue with JAXP/SAX/Xerces initially to see if it 
is a parser level issue, JSTL XML simply is a wrapper around JAXP.

-Mark
Dylan MacDonald wrote:
Hi -
I would like to store some multibyte content in an xml file and then
retrieve and display that content using the JSTL XML taglib.
This works beautifully with extended characters like é, ß, etc.  However the
application chokes on Unicode or UTF-8 encoded XML files with the error
"javax.servlet.jsp.JspException: Start of root element expected."  I believe
this is caused by the encoding adding extra characters to the beginning of
the file (before ). And, for what it's
worth, multibyte characters come out as garbage when the XML file is encoded
as ANSI.
Anyone have any ideas about how to store multibyte content in XML and then
successfully output it to a JSP?
Thanks,
Dylan MacDonald
Senior Web Designer
GNX
<
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Adding attributes to an XML element in JSTL

2004-05-07 Thread Mark R. Diggory
Kris Schneider wrote:

;-) I'm not sure how I got stuck holding the bag for "physically 
altering the original DOM object", JXPath was your suggestion, wasn't 
it? 
That wasn't my intention, I was just showing and optional strategy. I'm 
always one to play Devils Advocate... ;-) Lord knows I sometimes do 
things in JSP pages that would make Shawn Bayern come running back from 
Law School ;-)

My original response, which I still stand by, was, "It sounds like 
you'd be better off using XSLT and the  tag..." The two 
examples I gave below both use transformation and don't touch the 
original data. 
But you're absolutely right in that you need to take care 
with what you do in the name of presentation logic to ensure that side 
effects don't end up wreaking havoc on your model. Of course, that's 
generically applicable to other templating/scripting/view-rendering 
technologies besides JSP & JSTL.

this all makes sense, but with large amounts of data, transforms that 
are basically duplications of the content can get expensive. My own 
projects tend to push this envelope, so I get around the memory 
constraints by sometimes directly manipulating the DOM content using 
JXPath, but its usually in a control/model portion of the application 
(struts actions or servlets) not really ever in JSP's directly.

Lately I'm starting to work more with XMLDB and XUpdates, I'd like to 
eventually see a generic XUpdate engine that could easily be applied to 
DOM objects.

Cheers,
-Mark

Mark R. Diggory wrote:

Hey, if its all in the name of presentation, then who am I to argue.

But there is a conceptual dfiference your overlooking here. There is a 
big difference between taking a DOM and doing an xslt transform to 
produce new output vs. physically altering the original DOM object, 
The former is a "readonly" process, and the later is a "write" 
process. What if that DOM was actually implemented over some 
persistent source, now your using your presentation layer to do 
buisness logic...

Granted, JSTL already "bleeds" over the boundaries of "read/write" 
with the sql tags, and its rather difficult to define a boundary for 
objects acted on by the "c:set" tag as well.

-Mark

Kris Schneider wrote:

It's perfectly valid to perform those tasks for the sake of 
presentation logic.
Just because I'm manipulating an XML document doesn't mean that I'm 
performing
business logic. Does transforming your XML data to (X)HTML qualify as 
business
logic? As another example, an article by Bob DuCharme for XML.com
(http://www.xml.com/pub/a/2004/04/07/tr.html) outlines how to use 
XSLT to add
an id attribute to all elements, or to just a specific list of 
elements. This
may have nothing to do with business logic but it's quite useful for 
creating
links within an XHTML document. In fact, that article hits very close 
to a
solution for the original question...

Quoting Stefan Frank <[EMAIL PROTECTED]>:

 

hey, come on, this is just a jsp - you would not really want to 
litter your presentation layer with all sorts of business-logic: if 
jstl goes down this path, it will end up being a crippled version of 
cfml or even worse asp...

Murray Lang wrote:
 

Actually, what the Sun JSTL web page says is:

"JSTL has support for common, structural tasks such as iteration 
and conditionals, tags for manipulating XML documents, 
internationalization tags, and SQL tags."

"manipulating"!

Anyway, I take your point that it is outside the scope of the JSTL 
XML tags at the moment. It seems to me a rather arbitrary 
limitation though. As the JSTL documentation says: "...when 
companies cooperate over the web, XML is the data format of choice 
for exchanging information.". IMHO being unable to manipulate XML 
is odd for a technology that has such language in it's 
documentation. An exchange of information involves two parties, one 
at least of which has created some XML.

Thanks for the JXPath link. What worries me about it though is that 
it won't necessarily use the same DOM implementation as JSTL 
implementation, meaning that they won't work with each other. It 
seems a shame if this is the case. I'll look at it though - it 
might not be that bad.

Cheers
Murray


At 01:33 AM 7/05/2004, you wrote:

   

This is outside the scope of the taglibrary, JSTL xml taglibrary 
is for presentation of xml content, not for its manipulation. I 
recommend looking into a package such as JXPath to accomplish 
manipulation of the content of a DOM object. the nice thing is 
that JXPath can be scripted into a JSP, Servlet or Struts Action, 
which gives you the fredom to move it out of the Presentation 
layer (where you probibly shouldn't be placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

 

Hi
I&#

Re: Adding attributes to an XML element in JSTL

2004-05-07 Thread Mark R. Diggory
I believe you would get the parent element of the attribute and use a 
pointer to that Node to add the attribute. Look Over DOMNodePointer for 
more details.

http://jakarta.apache.org/commons/jxpath/apidocs/org/apache/commons/jxpath/ri/model/dom/DOMNodePointer.html

-Mark

Kris Schneider wrote:

That still doesn't seem to address the question about adding an attribute. If
the attribute doesn't exist, you can't access it with something like
domCtx.getPointer("root/child/@id"), right? I took a look at the API and this
seemed to work (JSTL 1.1, Xalan 2.6.0, and Xerces 2.6.2 on TC 5.0.19):
<%@ page contentType="text/plain" %>
<%@ page import="org.apache.commons.jxpath.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"; %>

   
   Child 1
   Child 2
   Child 3
   

child:
child id: 

<%
JXPathContext domCtx = JXPathContext.newContext(dom);
Pointer ptr = domCtx.getPointer("root/child");
Element elem = (Element)ptr.getNode();
elem.setAttribute("id", "1");
%>
child:
child id: 
Which produced:

child:Child 1
child id: 

child:Child 1
child id: 1
It looks like there's also a way to add an attribute through the JXPath API, but
you have to cast the Pointer to a NodePointer and the code's a bit uglier. Of
course, if you're gonna drop down to Java, there are lots of other options for
programmatically modifying DOM through XPath...
Quoting "Mark R. Diggory" <[EMAIL PROTECTED]>:

 

You can use JXPath to manipulate the content of the DOM directly (ie 
without having to instantiate a whole new copied DOM object to establish 
your changes (as you whould have to do with XSLT).

Say you instantiate some DOM Document object, you can use JXPath as such:

Document doc = ;
JXPathContext context = JXPathContext.newContext(doc);
Iterator iter = context.iteratePointers("//some[xpath]");
while (iter.hasNext()) {
 Pointer pointer = (Pointer) iter.next();
 System.out.println("value before change: " + pointer.getValue());
 pointer.setValue(value);
 System.out.println("value after change: " + pointer.getValue());
}
.. Serialize your DOM to wherever using whatever.

Yes, by scriptable, I mean you can write your java code between <%%> or 


Maybe someday there'll be a JXPath taglibrary which would make all this 
all grovy in JSP.

-Mark

Kris Schneider wrote:

   

I'm not too familiar with JXPath, and I'm sure it's useful in other
 

contexts,
   

but I don't see how it's applicable to Murray's problem. Can it be used to
     

add
   

an attribute to an existing element? I'm also not sure I get the point
 

about
   

"JXPath can be scripted into a JSP". Do you mean something besides:

<%
Foo fooCtx = (Foo)JXPathContext.newContext(myFoo);
%>
Quoting "Mark R. Diggory" <[EMAIL PROTECTED]>:



 

This is outside the scope of the taglibrary, JSTL xml taglibrary is for 
presentation of xml content, not for its manipulation. I recommend 
looking into a package such as JXPath to accomplish manipulation of the 
content of a DOM object. the nice thing is that JXPath can be scripted 
into a JSP, Servlet or Struts Action, which gives you the fredom to move 
it out of the Presentation layer (where you probibly shouldn't be 
placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

  

   

Hi
I've been using the XML tags in JSTL and found them very useful, 
however now I need to add an attribute to an XML element and have hit 
a brick wall.

I've tried using  and EL, treating a DOM object as a bean, but 
the DOM interface is implementation-dependent and my implementation 
(xerces) doesn't lend itself to adding attributes with the simple EL 
view of bean properties.

It seems to me that  needs to have a "target"attribute along 
the same lines as , but accepting an XPath expression.
eg
  
where:
  - select can be either an XPath expression or an immediate value.
  - if @myAttribute doesn't currently exist in the element then it 
is created.

Does this make sense?
Is there a simple, portable, way of achieving this using JSTL as it 
stands? (Using  is not portable due to DOM being implementation 
dependent).

Thanks
Murray
 

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Adding attributes to an XML element in JSTL

2004-05-07 Thread Mark R. Diggory
Hey, if its all in the name of presentation, then who am I to argue.

But there is a conceptual dfiference your overlooking here. There is a 
big difference between taking a DOM and doing an xslt transform to 
produce new output vs. physically altering the original DOM object, The 
former is a "readonly" process, and the later is a "write" process. What 
if that DOM was actually implemented over some persistent source, now 
your using your presentation layer to do buisness logic...

Granted, JSTL already "bleeds" over the boundaries of "read/write" with 
the sql tags, and its rather difficult to define a boundary for objects 
acted on by the "c:set" tag as well.

-Mark

Kris Schneider wrote:

It's perfectly valid to perform those tasks for the sake of presentation logic.
Just because I'm manipulating an XML document doesn't mean that I'm performing
business logic. Does transforming your XML data to (X)HTML qualify as business
logic? As another example, an article by Bob DuCharme for XML.com
(http://www.xml.com/pub/a/2004/04/07/tr.html) outlines how to use XSLT to add
an id attribute to all elements, or to just a specific list of elements. This
may have nothing to do with business logic but it's quite useful for creating
links within an XHTML document. In fact, that article hits very close to a
solution for the original question...
Quoting Stefan Frank <[EMAIL PROTECTED]>:

 

hey, come on, this is just a jsp - you would not really want to litter 
your presentation layer with all sorts of business-logic: if jstl goes 
down this path, it will end up being a crippled version of cfml or even 
worse asp...

Murray Lang wrote:
   

Actually, what the Sun JSTL web page says is:

"JSTL has support for common, structural tasks such as iteration and 
conditionals, tags for manipulating XML documents, internationalization 
tags, and SQL tags."

"manipulating"!

Anyway, I take your point that it is outside the scope of the JSTL XML 
tags at the moment. It seems to me a rather arbitrary limitation though. 
As the JSTL documentation says: "...when companies cooperate over the 
web, XML is the data format of choice for exchanging information.". IMHO 
being unable to manipulate XML is odd for a technology that has such 
language in it's documentation. An exchange of information involves two 
parties, one at least of which has created some XML.

Thanks for the JXPath link. What worries me about it though is that it 
won't necessarily use the same DOM implementation as JSTL 
implementation, meaning that they won't work with each other. It seems a 
shame if this is the case. I'll look at it though - it might not be that 
bad.

Cheers
Murray


At 01:33 AM 7/05/2004, you wrote:

 

This is outside the scope of the taglibrary, JSTL xml taglibrary is 
for presentation of xml content, not for its manipulation. I recommend 
looking into a package such as JXPath to accomplish manipulation of 
the content of a DOM object. the nice thing is that JXPath can be 
scripted into a JSP, Servlet or Struts Action, which gives you the 
fredom to move it out of the Presentation layer (where you probibly 
shouldn't be placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

   

Hi
I've been using the XML tags in JSTL and found them very useful, 
however now I need to add an attribute to an XML element and have hit 
a brick wall.

I've tried using  and EL, treating a DOM object as a bean, but 
the DOM interface is implementation-dependent and my implementation 
(xerces) doesn't lend itself to adding attributes with the simple EL 
view of bean properties.

It seems to me that  needs to have a "target"attribute along 
the same lines as , but accepting an XPath expression.
eg
   
where:
   - select can be either an XPath expression or an immediate value.
   - if @myAttribute doesn't currently exist in the element then it 
is created.

Does this make sense?
Is there a simple, portable, way of achieving this using JSTL as it 
stands? (Using  is not portable due to DOM being 
implementation dependent).

Thanks
Murray
 

--
Stefan Frank
iBioS - Intelligent BioInformatics Systems
http://www.dkfz-heidelberg.de/ibios
DKFZ - German Cancer Research Center
Im Neuenheimer Feld 580
69120 Heidelberg
Tel.: +49 (0) 6221 42-3612
Mail: [EMAIL PROTECTED]
   

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Adding attributes to an XML element in JSTL

2004-05-07 Thread Mark R. Diggory
Murray,

> "JSTL has support for common, structural tasks such as iteration and
> conditionals, tags for manipulating XML documents, internationalization
> tags, and SQL tags."
>
> "manipulating"!
Clearly that was a general statement not to be taken in a "Legal 
sense"... it is poorly stated

If you want things "in" JSTL, I would recommend you join the JCP that 
established it, this is simply an Apache project to establish a working 
reference implementation of the specification. We cannot make 
modifications to the taglibrary that will make it incompatible with the 
JSTL specification.

One could, however, extend the standard taglibrary themselves if they 
wished to have such functionality. There's no reason you can't write 
your own tag that will modify the XML dom. In fact, my earlier 
suggestion to use JXPath gives you most of the underlying implementation 
for manipulation...

Cheers,
Mark
Murray Lang wrote:

Actually, what the Sun JSTL web page says is:

Anyway, I take your point that it is outside the scope of the JSTL XML 
tags at the moment. It seems to me a rather arbitrary limitation though. 
As the JSTL documentation says: "...when companies cooperate over the 
web, XML is the data format of choice for exchanging information.". IMHO 
being unable to manipulate XML is odd for a technology that has such 
language in it's documentation. An exchange of information involves two 
parties, one at least of which has created some XML.

Thanks for the JXPath link. What worries me about it though is that it 
won't necessarily use the same DOM implementation as JSTL 
implementation, meaning that they won't work with each other. It seems a 
shame if this is the case. I'll look at it though - it might not be that 
bad.

Cheers
Murray


At 01:33 AM 7/05/2004, you wrote:

This is outside the scope of the taglibrary, JSTL xml taglibrary is 
for presentation of xml content, not for its manipulation. I recommend 
looking into a package such as JXPath to accomplish manipulation of 
the content of a DOM object. the nice thing is that JXPath can be 
scripted into a JSP, Servlet or Struts Action, which gives you the 
fredom to move it out of the Presentation layer (where you probibly 
shouldn't be placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

Hi
I've been using the XML tags in JSTL and found them very useful, 
however now I need to add an attribute to an XML element and have hit 
a brick wall.

I've tried using  and EL, treating a DOM object as a bean, but 
the DOM interface is implementation-dependent and my implementation 
(xerces) doesn't lend itself to adding attributes with the simple EL 
view of bean properties.

It seems to me that  needs to have a "target"attribute along 
the same lines as , but accepting an XPath expression.
eg

where:
- select can be either an XPath expression or an immediate value.
- if @myAttribute doesn't currently exist in the element then it 
is created.

Does this make sense?
Is there a simple, portable, way of achieving this using JSTL as it 
stands? (Using  is not portable due to DOM being 
implementation dependent).

Thanks
Murray
-
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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Adding attributes to an XML element in JSTL

2004-05-06 Thread Mark R. Diggory
You can use JXPath to manipulate the content of the DOM directly (ie 
without having to instantiate a whole new copied DOM object to establish 
your changes (as you whould have to do with XSLT).

Say you instantiate some DOM Document object, you can use JXPath as such:

Document doc = ;
JXPathContext context = JXPathContext.newContext(doc);
Iterator iter = context.iteratePointers("//some[xpath]");
while (iter.hasNext()) {
 Pointer pointer = (Pointer) iter.next();
 System.out.println("value before change: " + pointer.getValue());
 pointer.setValue(value);
 System.out.println("value after change: " + pointer.getValue());
}
.. Serialize your DOM to wherever using whatever.

Yes, by scriptable, I mean you can write your java code between <%%> or 


Maybe someday there'll be a JXPath taglibrary which would make all this 
all grovy in JSP.

-Mark

Kris Schneider wrote:

I'm not too familiar with JXPath, and I'm sure it's useful in other contexts,
but I don't see how it's applicable to Murray's problem. Can it be used to add
an attribute to an existing element? I'm also not sure I get the point about
"JXPath can be scripted into a JSP". Do you mean something besides:
<%
Foo fooCtx = (Foo)JXPathContext.newContext(myFoo);
%>
Quoting "Mark R. Diggory" <[EMAIL PROTECTED]>:

 

This is outside the scope of the taglibrary, JSTL xml taglibrary is for 
presentation of xml content, not for its manipulation. I recommend 
looking into a package such as JXPath to accomplish manipulation of the 
content of a DOM object. the nice thing is that JXPath can be scripted 
into a JSP, Servlet or Struts Action, which gives you the fredom to move 
it out of the Presentation layer (where you probibly shouldn't be 
placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

   

Hi
I've been using the XML tags in JSTL and found them very useful, 
however now I need to add an attribute to an XML element and have hit 
a brick wall.

I've tried using  and EL, treating a DOM object as a bean, but 
the DOM interface is implementation-dependent and my implementation 
(xerces) doesn't lend itself to adding attributes with the simple EL 
view of bean properties.

It seems to me that  needs to have a "target"attribute along 
the same lines as , but accepting an XPath expression.
eg
   
where:
   - select can be either an XPath expression or an immediate value.
   - if @myAttribute doesn't currently exist in the element then it 
is created.

Does this make sense?
Is there a simple, portable, way of achieving this using JSTL as it 
stands? (Using  is not portable due to DOM being implementation 
dependent).

Thanks
Murray
 

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Adding attributes to an XML element in JSTL

2004-05-06 Thread Mark R. Diggory
This is outside the scope of the taglibrary, JSTL xml taglibrary is for 
presentation of xml content, not for its manipulation. I recommend 
looking into a package such as JXPath to accomplish manipulation of the 
content of a DOM object. the nice thing is that JXPath can be scripted 
into a JSP, Servlet or Struts Action, which gives you the fredom to move 
it out of the Presentation layer (where you probibly shouldn't be 
placing such logic).

http://jakarta.apache.org/commons/jxpath/

Good Luck
-Mark
Murray Lang wrote:

Hi
I've been using the XML tags in JSTL and found them very useful, 
however now I need to add an attribute to an XML element and have hit 
a brick wall.

I've tried using  and EL, treating a DOM object as a bean, but 
the DOM interface is implementation-dependent and my implementation 
(xerces) doesn't lend itself to adding attributes with the simple EL 
view of bean properties.

It seems to me that  needs to have a "target"attribute along 
the same lines as , but accepting an XPath expression.
eg

where:
- select can be either an XPath expression or an immediate value.
- if @myAttribute doesn't currently exist in the element then it 
is created.

Does this make sense?
Is there a simple, portable, way of achieving this using JSTL as it 
stands? (Using  is not portable due to DOM being implementation 
dependent).

Thanks
Murray
-
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: maven repository

2004-04-21 Thread Mark R. Diggory
Not only this, I missed that these are not actually in the apache maven 
repository. hmm. I'm going to have to move these over from ibiblio. I 
wonder if I've missed anything else.

-Mark

Felipe Leme wrote:

Mark/Pierre,

Just now I started to use Maven in a project, and I think it's a very
good product.
So, at long term, I suggest that we add Maven support on our tags - it
would make it much easier to handle the dependencies and we could take
advantage of our existing xdocs documents.
Meanwhile, I could do the 'manueal update' Mark mentioned (in fact,
that's something we really must do, as the repository right now have the
1.0.2 artifacts, which are pretty old).
Felipe

PS: I think this discussion should be kept only in the devs list

On Sat, 2004-02-28 at 12:12, Mark R. Diggory wrote:
 

As taglibs currently doesn't take advantage of Maven for building, I 
expect we will use a manual solution for publsihing which would look 
something like:
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSLT question

2004-04-07 Thread Mark R. Diggory
Does your uri work? I tried it and got nothing, but you could be on an 
intranet.

http://raptor.mtc.ti.com:9081/rtdui/WebUI?action=getStationStatus

Whats your underlying JAXP transformer implementation? From my 
experience I believe both Saxon and Xalan support http url resolution 
within the document() function. This should work, I do it currently in 
our project using Tomcat 4.1, jstl 1.1 and Saxon 6.5.3.

JAXP does support the ability include a "URLResolver" which the 
document() function uses when doing resolution. My concern is that JSTL 
may attempt to place its own URLResolver in place...This would overide 
any default resolution behavior of the underlying implementation.

-Mark

Kris Schneider wrote:

The type of the scoped varible named by the "var" attribute of  is
String. Since String is also an acceptable type for both the "doc" and "xslt"
attributes of , you should be able to do:



As for the HTTP error, the handling of the URI passed to the document function
is under the control of the XSLT processor. In fact, the XSLT spec says, "An
XSLT processor is not required to support any particular URI schemes."
Although, in practice, http is a pretty likely candidate for support. Even if
it is supported, it's up to the XSLT processor implementation to handle the
generation of the http request, which may or may not play nicely with your
middleware setup. Hence, my attempt at an alternate approach. Can you provide a
snippet from your stylesheet where you're using the document function?
If it's still of any help, here's what it looks like my example would be with
your setup (assuming the "WebUI" servlet is part of the same app):

   





   

Quoting "Johnson, Chris" <[EMAIL PROTECTED]>:

 

Still nothing.  But, the error message did change (see below).  It now
has the station_list file as the file containing the offending url.
Before it was some crazy file that doesn't exist.  But, I'm still
getting the same error.  Is it possible that it can't get output from a
servlet (in the same context anyway)?  If I call the url in a brower, it
works fine, so I know the url is valid, and there's valid xml being
returned.
jstl:station_list.xsl; Line #9; Column #124; Can not load requested doc:
Server returned HTTP response code: 500 for URL:
http://raptor.mtc.ti.com:9081/rtdui/WebUI?action=getStationStatus
-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 07, 2004 12:52 PM
To: Tag Libraries Users List
Subject: Re: XSLT question

Try just:



 
I speculate that the c:import stores the content in a byte[] or pulls it
as an InputStream, creating a jaxp StreamSource for the template, the
problem is that the systemId gets lost in the process, for me its just a
workaround to stick it back into the JAXP transformers template Source
object. I really think JSTL is poorly mapped to JAXP, I believe one
should just be able to do


without all the importing crap...

-Mark

Johnson, Chris wrote:

   

I guess I don't understand what the xlstSystemId needs to be set to.

Here's my code as it is now:



 

Inside this transform, I want to access something like: 
http://host.name.com:port/context/servlet?param=value

I'm running tomcat 5.0.19 and JSTL 1.1

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 07, 2004 12:29 PM
To: Tag Libraries Users List
Subject: Re: XSLT question
Johnson, Chris wrote:



 

I guess what I really want is an answer as to why document() isn't
working as it seems it should.
  

   

Mostly, I think the unexpected behavior has to do with the standard
implementations masking of underlying absolute paths to be relative to 
the webapplication instead of the filesystem. For example, if your 
webapp was installed in /usr/share/tomcat4/webapps/blaa

/foo/bar actually maps to /usr/share/tomcat4/webapps/blaa/foo/bar.



 

Besides, I'm already doing a transform on one document, so I don't
understand how doing this second transform on this other "document" 
(servlet call) would be able to be used in the first transform.
   

That's
   

  

   



 

why I was using document(), so I could read in another xml doc while
doing a transform.  I'm using the 2nd doc to do some conditional stuff
   

in the first transform.

  

   

I do it now, but I'm working on tomcat4.1 and jstl 1.1



 

But since I had nowhere to go but up, I did part of what Kris said.  I
tried doing an import of the doc, which worked, but I put the output 
(after parsing) into an x:param associated with the original (only) 
transform.  But that doesn't seem to work.

  

   

It wouldn't really because most transformers use a different object 
tree

than DOM which the x:parse is producing.



 

If I do a 2nd transform on 

Re: XSLT question

2004-04-07 Thread Mark R. Diggory
Try just:





I speculate that the c:import stores the content in a byte[] or pulls it as an InputStream, creating a jaxp StreamSource for the template, the problem is that the systemId gets lost in the process, for me its just a workaround to stick it back into the JAXP transformers template Source object. I really think JSTL is poorly mapped to JAXP, I believe one should just be able to do



without all the importing crap...

-Mark

Johnson, Chris wrote:

I guess I don't understand what the xlstSystemId needs to be set to.

Here's my code as it is now:





Inside this transform, I want to access something like:
http://host.name.com:port/context/servlet?param=value
I'm running tomcat 5.0.19 and JSTL 1.1

-Original Message-----
From: Mark R. Diggory [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 07, 2004 12:29 PM
To: Tag Libraries Users List
Subject: Re: XSLT question

Johnson, Chris wrote:

 

I guess what I really want is an answer as to why document() isn't 
working as it seems it should.

   

Mostly, I think the unexpected behavior has to do with the standard 
implementations masking of underlying absolute paths to be relative to 
the webapplication instead of the filesystem. For example, if your 
webapp was installed in /usr/share/tomcat4/webapps/blaa

/foo/bar actually maps to /usr/share/tomcat4/webapps/blaa/foo/bar. 

 

Besides, I'm already doing a transform on one document, so I don't 
understand how doing this second transform on this other "document" 
(servlet call) would be able to be used in the first transform.  That's
   

 

why I was using document(), so I could read in another xml doc while 
doing a transform.  I'm using the 2nd doc to do some conditional stuff 
in the first transform.

   

I do it now, but I'm working on tomcat4.1 and jstl 1.1

 

But since I had nowhere to go but up, I did part of what Kris said.  I 
tried doing an import of the doc, which worked, but I put the output 
(after parsing) into an x:param associated with the original (only) 
transform.  But that doesn't seem to work.

   

It wouldn't really because most transformers use a different object tree

than DOM which the x:parse is producing.

 

If I do a 2nd transform on the 2nd doc, how do I reference that in the 
first transform?

   

Did you try adding the xlstSystemId? this sets the systemId of the xslt 
and allows the document function to do relative resolution from the 
systemId, thats just straight xslt spec/JAXP  behavior. I'm using it in 
jstl 1.1 because of this very issue.

What version of JSTL/standard.jar are you working with, which version of

Tomcat?

 

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 07, 2004 12:04 PM
To: Tag Libraries Users List
Subject: Re: XSLT question
Try setting the systemId for the stylesheet, this may help configure 
the

proper resolution.

  
   -Mark

Kris Schneider wrote:



   

As an alternative, perhaps you can use an XSLT parameter to hold the
servlet
output:



  
Where your stylesheet would include an  element:



Haven't tried this with a full-blown document as a parameter before...

Quoting "Johnson, Chris" <[EMAIL PROTECTED]>:



  

 

I'm having trouble using the XSLT document() function.

What I need to do is to call a servlet which will send back some
dynamic xml that I need to reference in my XSLT template.
I've tried using various relative paths, and the full (http://...)
path with no luck.  When I use the full path, I get this error in the
   

 

catalina.out file: Can not load requested doc: Server returned HTTP 
response code: 500 for
URL: http:...  I've made sure there are no typos in the url.

When using a relative path, the error suggests that document() is
looking for the resource as a file on the server.
I've looked around on the web and see people supposedly using
document() with full paths, but nothing describing the problem I'm 
having.

Any help would be greatly appreciated.

Thanks,
Chris
 



   

  

 

-
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]


   



-
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]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSLT question

2004-04-07 Thread Mark R. Diggory
Johnson, Chris wrote:

I guess what I really want is an answer as to why document() isn't
working as it seems it should.
 

Mostly, I think the unexpected behavior has to do with the standard 
implementations masking of underlying absolute paths to be relative to 
the webapplication instead of the filesystem. For example, if your 
webapp was installed in /usr/share/tomcat4/webapps/blaa

/foo/bar actually maps to /usr/share/tomcat4/webapps/blaa/foo/bar. 

Besides, I'm already doing a transform on one document, so I don't
understand how doing this second transform on this other "document"
(servlet call) would be able to be used in the first transform.  That's
why I was using document(), so I could read in another xml doc while
doing a transform.  I'm using the 2nd doc to do some conditional stuff
in the first transform.
 

I do it now, but I'm working on tomcat4.1 and jstl 1.1

But since I had nowhere to go but up, I did part of what Kris said.  I
tried doing an import of the doc, which worked, but I put the output
(after parsing) into an x:param associated with the original (only)
transform.  But that doesn't seem to work.
 

It wouldn't really because most transformers use a different object tree 
than DOM which the x:parse is producing.

If I do a 2nd transform on the 2nd doc, how do I reference that in the
first transform?
Did you try adding the xlstSystemId? this sets the systemId of the xslt 
and allows the document function to do relative resolution from the 
systemId, thats just straight xslt spec/JAXP  behavior. I'm using it in 
jstl 1.1 because of this very issue.

What version of JSTL/standard.jar are you working with, which version of 
Tomcat?

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 07, 2004 12:04 PM
To: Tag Libraries Users List
Subject: Re: XSLT question

Try setting the systemId for the stylesheet, this may help configure the

proper resolution.

   
-Mark
Kris Schneider wrote:

 

As an alternative, perhaps you can use an XSLT parameter to hold the 
servlet
output:




   
Where your stylesheet would include an  element:



Haven't tried this with a full-blown document as a parameter before...

Quoting "Johnson, Chris" <[EMAIL PROTECTED]>:



   

I'm having trouble using the XSLT document() function.

What I need to do is to call a servlet which will send back some 
dynamic xml that I need to reference in my XSLT template.

I've tried using various relative paths, and the full (http://...) 
path with no luck.  When I use the full path, I get this error in the 
catalina.out file: Can not load requested doc: Server returned HTTP 
response code: 500 for
URL: http:...  I've made sure there are no typos in the url.

When using a relative path, the error suggests that document() is 
looking for the resource as a file on the server.

I've looked around on the web and see people supposedly using 
document() with full paths, but nothing describing the problem I'm 
having.

Any help would be greatly appreciated.

Thanks,
Chris
  

 



   



-
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]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSLT question

2004-04-07 Thread Mark R. Diggory
Try setting the systemId for the stylesheet, this may help configure the 
proper resolution.

   
   
-Mark
Kris Schneider wrote:

As an alternative, perhaps you can use an XSLT parameter to hold the servlet
output:



   

Where your stylesheet would include an  element:



Haven't tried this with a full-blown document as a parameter before...

Quoting "Johnson, Chris" <[EMAIL PROTECTED]>:

 

I'm having trouble using the XSLT document() function.

What I need to do is to call a servlet which will send back some dynamic
xml that I need to reference in my XSLT template.
I've tried using various relative paths, and the full (http://...) path
with no luck.  When I use the full path, I get this error in the
catalina.out file:
Can not load requested doc: Server returned HTTP response code: 500 for
URL: http:...  I've made sure there are no typos in the url.
When using a relative path, the error suggests that document() is
looking for the resource as a file on the server.
I've looked around on the web and see people supposedly using document()
with full paths, but nothing describing the problem I'm having.
Any help would be greatly appreciated.

Thanks,
Chris 
   

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: File/Directory Manipulation Tag Libraries

2004-03-04 Thread Mark R. Diggory
One strategy we've discussed in the past is to use the JNDI taglibrary 
plus the default java:env/Resources jndi context in the webapplication 
as a mechanism to list the contents of the directories (this allows 
listing of both webapplications that are expanded into the filesystem 
and webapplications that are mounted as WAR files). This however, is an 
"read only" solution.

-Mark

Derek wrote:

Ananth,

You can check out all of the standard Jakarta/Tomcat
libraries here:
http://jakarta.apache.org/taglibs/index.html

Upon an initial scan and having worked with several of
those libraries, it does not appear as though any of
them handle directory or file manipulation.  There are
several servlets available (do a Google search for
"file servlet" and you should find a few).
There may also be a few third-party file/directory
manipulation tag libraries -- doing a search on google
for "file jsp tag libraries" might give you a few
hits.
Also, depending on your goals, you can turn on
directory browsing for a particular area of your site,
giving the user a standard Tomcat directory browser. 
I believe you that you can turn that on in the
 area somewhere.  I also think that it's
turned on by default if you do not have a file
corresponding to the  tag defined.

[FYI Ananth, please update the subject line to be
representative of your question so we don't get it
mixed in with other threads.  I forget every
once-in-a-while as well.  Thanks!]
Thanks!
Derek
--- Ananth R <[EMAIL PROTECTED]> wrote:

Hello

Any body knows how to display the directory
structure using a JSP page 
using taglibraries.

ie are there any taglibraries for visualizing a
directory structures.
Any frame work available in Jakarta project to do
this???
please inform me.

--

A N A N T H. R




-

To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: xslt expression

2004-03-03 Thread Mark R. Diggory
I suspect you need to determine if your using the EL verison or the RT 
version. The RT verison does not support ${} expression syntax, maybe 
try <%=page.getAttribute("xslt")%> instead and see if it still doesn't work.



Thomas McDonald wrote:

Nope, didn't work.  thanks though.

I have a funny feeling this has something to do with
either the web.xml file and or the .tld file
--- "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]> wrote:

Try changing the name of
url="/includes/xslt/sortablegrid.xslt" to
url="/includes/xslt/sortablegrid.xsl"
The name of the file should not include .xslt but
should be .xsl
-Original Message-
From: Thomas McDonald [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 3:09 PM
To: [EMAIL PROTECTED]
Subject: xslt expression

I keep getting the error "According to TLD or
attribute directive in tag file, attribute xslt does
not accept any expressions"
"doesn't accept expressions??!!"  That seems
absolutely crazy to me.  Does it really want me to
type in a whole xsl document?  I have to deliver the
xsl document via an expression.  I must be doing
something wrong.  Any ideas?
Here is my code code:

<%@ taglib prefix="c"
uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="x"
uri="http://java.sun.com/jstl/xml"; %>


<%=objXML.getXml().toString().trim()%>

__
Do you Yahoo!?
Yahoo! Search - Find what you're looking for faster
http://search.yahoo.com

-

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]


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: maven repository

2004-02-28 Thread Mark R. Diggory
As taglibs currently doesn't take advantage of Maven for building, I 
expect we will use a manual solution for publsihing which would look 
something like:

1.) create a project directory for taglibs that looks like

/www/www.apache.org/dist/java-repository/jakarta-taglibs/jars/standard-.jar
/www/www.apache.org/dist/java-repository/jakarta-taglibs/jars/jndi-.jar
/www/www.apache.org/dist/java-repository/jakarta-taglibs/jars/-.jar
to get an idea of what we can do with tlds, look over the struts 
directory at this time:

http://www.apache.org/dist/java-repository/struts/

in which case we could have the following place to store the tlds

/www/www.apache.org/dist/java-repository/jakarta-taglibs/tld/standard-.tld
/www/www.apache.org/dist/java-repository/jakarta-taglibs/tld/jndi-.tld
/www/www.apache.org/dist/java-repository/jakarta-taglibs/tld/-.tld
2.) for the last couple releases we should probibly just extract the 
jars from the tar ball distributions and generate md5's for them.

3.) finally, a SNAPSHOT symlink and reference file should be generate 
which points to the latest release for each taglib:

standard-SNAPSHOT.jar --> jakarta-taglibs/jars/standard-.jar
standard-snapshot-version   (containing: )
that would make any jar or tld then available for download by Maven.

-Mark

Pierre Delisle wrote:

Taglibrary developers: This is an excellent example of how to take 
advantage of the new Apache Maven Repository. Taglibs Developers, how 
about publishing your taglibrary jars into the Maven Repository under 
/dist/java-repository. They'll get updated onto ibiblio.org/maven 
within 4 hours for Maven users to have accessibility to.


Mark,

Sounds like a great idea, but I'm in the dark wrt Maven. Can you guide us?

  -- Pierre

-Mark

Daniel Draws wrote:

In the last days I've tested the realy nice maven. But for the 
applications web-tier I need the jakarta-taglibs And I can't find any 
remote repository including them.

Is there anybody who knows a remote repository including the 
jakarta-taglibs. Or knows anybody another solution How to simply 
declare the dependencies and resolve them in the build process.

thx

daniel

-
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]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: maven repository

2004-02-27 Thread Mark R. Diggory
Taglibrary developers: This is an excellent example of how to take 
advantage of the new Apache Maven Repository. Taglibs Developers, how 
about publishing your taglibrary jars into the Maven Repository under 
/dist/java-repository. They'll get updated onto ibiblio.org/maven within 
4 hours for Maven users to have accessibility to.

-Mark

Daniel Draws wrote:

In the last days I've tested the realy nice maven. But for the 
applications web-tier I need the jakarta-taglibs And I can't find any 
remote repository including them.

Is there anybody who knows a remote repository including the 
jakarta-taglibs. Or knows anybody another solution How to simply declare 
the dependencies and resolve them in the build process.

thx

daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: question regarding xsl

2004-02-23 Thread Mark R. Diggory
use JSTL parsing and transform taglibraries.

MARU, SOHIL (SBCSI) wrote:

Hello All,
   I am new to using taglibs and hence the following question. I am using
struts but want to use XSL as my view instead of JSP.For this I was planning
on using the XSL tag library release but I saw a message that says its
deprecated. However when I try to find the latest Xtag(which is to be used
as replacement) release, I do not see any binaries in the download section.
Any idea where I can find that? 
thanks,
Sohil

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2004-01-09 Thread Mark R. Diggory
I remember something about the default /servlet/ path getting "locked 
down" secured from unauthorized access in 4.1, if you look in the 
web.xml there are not any ServletMappings, try adding ServletMappings 
for those uri's that are used

  
parserupload
/servlet/parserupload
  
  
requestupload
/servlet/requestupload
  
I don't acually use these servlets right now. please let me know how it 
goes.

-Mark

Rudi Doku wrote:

Hi Mark,

Sorry to approach you this way. I noticed that you are using the COS
library. I have tried to run the test application without any luck.
Firstly, I extracted the upload.war file from the zip file and placed it in
the webapps directory.
I then tried to run the application the following way:

I entered http://localhost:8080/upload/index.html in my browser only to get
the following error:
HTTP Status 404 - /upload/servlet/parserupload

The requested resource (/upload/servlet/parserupload) is not available.

I'm sure the solution is probably very straightforward, however, I'm new to
deploying servlets so I could do with some help.
Thanks in advance.

Rudi

-----Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]
Sent: 02 December, 2003 7:02 PM
To: Tag Libraries Users List
Subject: Re: Multipart/form-data support in Struts
I've been using the COS library, its a bit lower level but currently
meets my streaming needs for things like DOM'ing and XSL transforming
straight off the request input stream.
http://www.servlets.com/cos/index.html

-Mark

K.C. Baltz wrote:


One of the example webapps included with Struts 1.1 is struts-upload.
I've based my code off that.  You'll probably want the source
distribution of Struts to see how it's done.
K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is
there
any tag in struts which I can use in my application to achieve this???
Your response is highly appreciated

Regards/Ravi Krishna

-
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]


--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
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]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: how to look up java:comp/env

2003-12-16 Thread Mark R. Diggory
I was thinking about this last weekend. I did finally work through some 
of the examples with the JNDI taglibrary. There are examples in the 
usage of that jndi taglibrary that show both the resources and the env 
available to a webapplications under:

java:comp/...

The simplest example of navigating this hierarchy using the jndi taglib 
is this:

<%@ page errorPage="/Error/ErrorPage.jsp" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/jndi-1.0"; prefix="jndi" %>
<%
String name = request.getParameter("name") != null ? 
request.getParameter("name") : "";
String url = request.getParameter("url") != null ? 
request.getParameter("url") : "java:comp";
%>


The Context is <%=test.toString()%>"
			

namefull nameclasstoString of Object
  
contextRef='test'
name='<%=name%>'
nameId="aName"
classId="aClass"
objId="anObj"
bindings="false"
  >
<%
String nextContext, dn;
if (anObj instanceof javax.naming.Context) {
nextContext = ((javax.naming.Context)anObj).composeName(aName, 
request.getParameter("name"));
dn = ((javax.naming.Context)anObj).getNameInNamespace();
%>
	
  <%=aName%>
  	  [list]
  <%=dn%>
  <%=aClass%>
  <%=anObj%>

<%} else {
nextContext=test.composeName(aName, name);
dn = "N/A";
%>
	
  <%=aName%>
  	  [list]
  <%=dn%>
  <%=aClass%>
  <%=anObj%>


<%}%>
  

This thread in archive:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg05920.html
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: how to look up java:comp/env

2003-12-04 Thread Mark R. Diggory
This is an excellent question. To extend upon it: What are the jndi 
contexts (if any) available to a webapplications? This is probibly very 
specific to implementation and configuration and answers may vary across 
vendors. In tomcat is there a specific mechanism for exposing contexts 
in the environment of a web apllication?

-Mark

Kyunam Kim wrote:

How do I look up java:comp/env/something using jndi taglib on Tomcat?
 
Thanks.
Q
 
The information transmitted in [and/or attached to] this email is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. Use, disclosure, or
reproduction of this email by anyone other than the intended
recipient(s) is strictly prohibited. If you have received this e-mail in
error please delete it and notify the sender immediately. Any views
expressed in this message are those of the individual sender, except
where the sender specifically states them to be the views of IIT. No
representation is made that this email or any attachments are free of
viruses. Virus scanning is recommended and is the responsibility of the
recipient.
 

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSTL and LDAP

2003-12-03 Thread Mark R. Diggory
You can use the Realm of the Tomcat server to authenticate users and 
match them to roles (basically Groups stored in the ldap server). If you 
do this then you don't really need to use taglibs to manage the login. 
You just have to configure your web.xml with a login-config and the 
server.xml with a JNDI Realm.

The Tomcat examples/documentation shows how to do this fairly well:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JNDIRealm
I've had to do some tweeks of this in the past to work with our freakn' 
wierd LDAP configuration (again, entirely my own fault).

There is the JNDI taglibrary, which could be used in conjunction with an 
LDAP server to determine if a user could bind to an LDAP server, but I 
wouldn't recommend using it for that specifically, thats what JNDIRealm 
is primarily for.

-Mark

Dylan MacDonald wrote:

Hi -

I am just beginning to use the JSTL and my first project is redoing our
company's intranet.  Currently we use LDAP to provide authentication.  This
is done via a .htaccess file in the root of the site and the LDAP mod for
Apache.
I would like to convert this to either a Tomcat realms configuration or
(even better) a JSP login page that communicates with the LDAP server.  Does
anyone have any advice (ideally with code samples) about how to do this?  Do
the JSTL taglibs have some kind of LDAP support built in or are there other
taglibs that provide this kind of functionality?  I haven't had much luck
with my syntax in the  section of the server.xml.
Thanks in advance!

Dylan MacDonald
<

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-03 Thread Mark R. Diggory
Martin, sorry, I just noticed the depricated FileUpload code in the 
struts does some of this.

http://cvs.apache.org/viewcvs/jakarta-struts/src/share/org/apache/struts/upload/

-Mark

Mark R. Diggory wrote:

Martin,

This could probably be more appropriate for Commons Developer, but:

Any thoughts on a "pull" model Uploader for Commons Upload? Something 
that might return an Iterator over the multipart request stream in place 
of a List of processed FileItems? Just because its a design pattern 
taken advantage of in COS doesn't mean that its proprietary and can't be 
used in other tools like Commons FileUpload. There are many significant 
examples of the application of such a design pattern.

Iterator parseRequestIterator(javax.servlet.http.HttpServletRequest req)

I'd imagine something that returned an iterator of FileItem's instead of 
a List. Then FileItem's InputStream methods could stream directly from 
the request if it was a first pass or possibly draw from a cache of the 
contents in a temp file.

This would be something that could be used easily in collaboration with 
other libraries such as JAXP/SAX or other streaming libraries.

Another idea is to support some sort of "Filter" pipelining such that 
"MultipartFilter" could be written to process the InputStream prior to 
the creation of the temp file in the Repository...

Request Stream
  --> MultipartFilter (could match on param name) lots of cool custom 
processing, SAX, XSLT etc.)
 --> InputStream
   --> File

-Mark

Martin Cooper wrote:

On Tue, 2 Dec 2003, Mark R. Diggory wrote:


I've been using the COS library, its a bit lower level but currently
meets my streaming needs for things like DOM'ing and XSL transforming
straight off the request input stream.
http://www.servlets.com/cos/index.html


With file upload capability built into Struts, I'm curious as to why you
would choose to use a different library?
One thing to watch out for with the COS library is the license. If you 
use
it in a commercial application, you are *required* to purchase copies of
(the latest edition of) Jason Hunter's book for every developer. See:

http://www.servlets.com/cos/license.html

Strange but true...

--
Martin Cooper


-Mark

K.C. Baltz wrote:


One of the example webapps included with Struts 1.1 is struts-upload.
I've based my code off that.  You'll probably want the source
distribution of Struts to see how it's done.
K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is
there
any tag in struts which I can use in my application to achieve this???
Your response is highly appreciated

Regards/Ravi Krishna

-
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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-03 Thread Mark R. Diggory
The actual form and action are located here:

http://cvs.apache.org/viewcvs/jakarta-struts/src/upload/org/apache/struts/webapp/upload/UploadAction.java?rev=1.8&content-type=text/vnd.viewcvs-markup
http://cvs.apache.org/viewcvs/jakarta-struts/src/upload/org/apache/struts/webapp/upload/UploadForm.java?rev=1.9&content-type=text/vnd.viewcvs-markup
Mark R. Diggory wrote:

You can also see this via the web:

examples of the upload JSP's K.C. is refering to

http://cvs.apache.org/viewcvs/jakarta-struts/web/upload/upload.jsp?rev=1.6&content-type=text/vnd.viewcvs-markup 

struts-config

http://cvs.apache.org/viewcvs/jakarta-struts/web/upload/WEB-INF/struts-config.xml?rev=1.6&content-type=text/vnd.viewcvs-markup 



Ravi Krishna wrote:

Oh Thnx a ton  all of u,
I could fix it
 Regards,RaviKrishna
 -Original Message-
From: K.C. Baltz [mailto:[EMAIL PROTECTED] Sent:Tuesday, 
December 02, 2003 10:05 PM
To:Tag Libraries Users List
Subject:Re: Multipart/form-data support in Struts

One of the example webapps included with Struts 1.1 is 
struts-upload.   I've based my code off that.  You'll probably want 
the source distribution of Struts to see how it's done.

K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is 
there
any tag in struts which I can use in my application to achieve this???

Your response is highly appreciated

Regards/Ravi Krishna

-
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]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-03 Thread Mark R. Diggory
You can also see this via the web:

examples of the upload JSP's K.C. is refering to

http://cvs.apache.org/viewcvs/jakarta-struts/web/upload/upload.jsp?rev=1.6&content-type=text/vnd.viewcvs-markup

struts-config

http://cvs.apache.org/viewcvs/jakarta-struts/web/upload/WEB-INF/struts-config.xml?rev=1.6&content-type=text/vnd.viewcvs-markup

Ravi Krishna wrote:

Oh Thnx a ton  all of u,
I could fix it
 Regards,RaviKrishna
 -Original Message-
From: 	K.C. Baltz [mailto:[EMAIL PROTECTED] 
Sent:	Tuesday, December 02, 2003 10:05 PM
To:	Tag Libraries Users List
Subject:	Re: Multipart/form-data support in Struts

One of the example webapps included with Struts 1.1 is struts-upload.   
I've based my code off that.  You'll probably want the source 
distribution of Struts to see how it's done.

K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is there
any tag in struts which I can use in my application to achieve this???
Your response is highly appreciated

Regards/Ravi Krishna

-
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]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-02 Thread Mark R. Diggory
Martin,

This could probably be more appropriate for Commons Developer, but:

Any thoughts on a "pull" model Uploader for Commons Upload? Something 
that might return an Iterator over the multipart request stream in place 
of a List of processed FileItems? Just because its a design pattern 
taken advantage of in COS doesn't mean that its proprietary and can't be 
used in other tools like Commons FileUpload. There are many significant 
examples of the application of such a design pattern.

Iterator parseRequestIterator(javax.servlet.http.HttpServletRequest req)

I'd imagine something that returned an iterator of FileItem's instead of 
a List. Then FileItem's InputStream methods could stream directly from 
the request if it was a first pass or possibly draw from a cache of the 
contents in a temp file.

This would be something that could be used easily in collaboration with 
other libraries such as JAXP/SAX or other streaming libraries.

Another idea is to support some sort of "Filter" pipelining such that 
"MultipartFilter" could be written to process the InputStream prior to 
the creation of the temp file in the Repository...

Request Stream
  --> MultipartFilter (could match on param name) lots of cool custom 
processing, SAX, XSLT etc.)
 --> InputStream
   --> File

-Mark

Martin Cooper wrote:

On Tue, 2 Dec 2003, Mark R. Diggory wrote:


I've been using the COS library, its a bit lower level but currently
meets my streaming needs for things like DOM'ing and XSL transforming
straight off the request input stream.
http://www.servlets.com/cos/index.html


With file upload capability built into Struts, I'm curious as to why you
would choose to use a different library?
One thing to watch out for with the COS library is the license. If you use
it in a commercial application, you are *required* to purchase copies of
(the latest edition of) Jason Hunter's book for every developer. See:
http://www.servlets.com/cos/license.html

Strange but true...

--
Martin Cooper


-Mark

K.C. Baltz wrote:


One of the example webapps included with Struts 1.1 is struts-upload.
I've based my code off that.  You'll probably want the source
distribution of Struts to see how it's done.
K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is
there
any tag in struts which I can use in my application to achieve this???
Your response is highly appreciated

Regards/Ravi Krishna

-
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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-02 Thread Mark R. Diggory
1.) Historical (When we started writing our project there were no 
multipart parsing libraries available other than COS).

2.) We aren't commercial, Yet I do actually own Jason's Book.

3.) I don't actually use Struts in my applications right now. I don't 
want to be dependent on yet another framework other than straight up 
Servlets and JSP.

4.) I want to "validate" and "prune" the content of the Request 
InputStream directly, prior to allocating disk space for it. I actually 
SAX parse the the request stream content for the file through a sax 
Filter, there I can control certain features of uploaded xml content I 
want to maintain and others that we don't allow my user to maintain, I 
save memory and disk space by dropping SAX events for that content. XML 
Metadata documents for statistical data files can get huge (larger than 
the data files themselves), I'd rather use Streaming capabilities on 
them and not have to manipulate the content that I'll never actually 
maintain.

-Mark

Martin Cooper wrote:

On Tue, 2 Dec 2003, Mark R. Diggory wrote:


I've been using the COS library, its a bit lower level but currently
meets my streaming needs for things like DOM'ing and XSL transforming
straight off the request input stream.
http://www.servlets.com/cos/index.html


With file upload capability built into Struts, I'm curious as to why you
would choose to use a different library?
One thing to watch out for with the COS library is the license. If you use
it in a commercial application, you are *required* to purchase copies of
(the latest edition of) Jason Hunter's book for every developer. See:
http://www.servlets.com/cos/license.html

Strange but true...

--
Martin Cooper


-Mark

K.C. Baltz wrote:


One of the example webapps included with Struts 1.1 is struts-upload.
I've based my code off that.  You'll probably want the source
distribution of Struts to see how it's done.
K.C.

Ravi Krishna wrote:


Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is
there
any tag in struts which I can use in my application to achieve this???
Your response is highly appreciated

Regards/Ravi Krishna

-
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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-02 Thread Mark R. Diggory
Forgot to mention, COS has licensing restrictions that limit its use in 
commercial products.

-M.

Mark R. Diggory wrote:

I've been using the COS library, its a bit lower level but currently 
meets my streaming needs for things like DOM'ing and XSL transforming 
straight off the request input stream.

http://www.servlets.com/cos/index.html

-Mark

K.C. Baltz wrote:

One of the example webapps included with Struts 1.1 is 
struts-upload.   I've based my code off that.  You'll probably want 
the source distribution of Struts to see how it's done.

K.C.

Ravi Krishna wrote:

Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is 
there
any tag in struts which I can use in my application to achieve this???

Your response is highly appreciated

Regards/Ravi Krishna

-
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]

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multipart/form-data support in Struts

2003-12-02 Thread Mark R. Diggory
I've been using the COS library, its a bit lower level but currently 
meets my streaming needs for things like DOM'ing and XSL transforming 
straight off the request input stream.

http://www.servlets.com/cos/index.html

-Mark

K.C. Baltz wrote:

One of the example webapps included with Struts 1.1 is struts-upload.   
I've based my code off that.  You'll probably want the source 
distribution of Struts to see how it's done.

K.C.

Ravi Krishna wrote:

Hey Guys , I want to upload data of wave , jpeg and MPEG formats .Is 
there
any tag in struts which I can use in my application to achieve this???

Your response is highly appreciated

Regards/Ravi Krishna

-
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]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Possible Bug in transform tag?

2003-11-21 Thread Mark R. Diggory
I've been working with the transform tag and may have possibly 
encountered a bug, shouldn't it be possible to do the following?


   
  
   

-Mark

--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: is this link correct?

2003-10-20 Thread Mark R. Diggory
Doh, My bad, your correct.

Kris Schneider wrote:

You shouldn't need anything in web.xml

JSP 1.2 / JSTL 1.0:
http://java.sun.com/jstl/core
JSP 2.0 / JSTL 1.1:
http://java.sun.com/jsp/jstl/core
And make sure the necessary JAR files are in WEB-INF/lib...

Quoting "Mark R. Diggory" <[EMAIL PROTECTED]>:


Are you adding the taglib mapping to your web.xml?

for example

  
http://java.sun.com/jstl/core
/WEB-INF/tld/c.tld
  
David Liles wrote:


I am trying to use jstl and when I include the following line in my JSP I
get an error indicating it can not find the uri

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

Is this link even valid?
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: is this link correct?

2003-10-20 Thread Mark R. Diggory
Are you adding the taglib mapping to your web.xml?

for example

  
http://java.sun.com/jstl/core
/WEB-INF/tld/c.tld
  
David Liles wrote:

I am trying to use jstl and when I include the following line in my JSP I get an error indicating it can not find the uri
 
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

Is this link even valid?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: Multiple attributes within an element - Is this a legal thingto do?

2003-10-20 Thread Mark R. Diggory


Frank Börncke wrote:
Thanks for your reply.


Sorry, from all my understanding, thats just not allowed in XML.


JSP looks like XML but is it required for JSP to exactly match
the XML restrictions?
I would avoid anything thats not XML, JSP's can also be written as legal 
XML. If you violate the XML standard then your tags cannot be used in 
JSP's which adhere to XML standards. In a world where designs are 
rapidly moving towards XML (with the introduction of EL and jsp tags  to 
replace <%%> scriptlets, thinking ahead would be a wise thing to do.

At least multiple attributes work in Tomcat 4.1.12 quite fine.
I doubt this was really meant to be a feature.

If I use this feature(?) in our project, I am am not sure if 
this will create problems in future versions of Tomcat or other 
servlet containers. The JSP specification seems to be not
clear in this point (at least I found no statement concerning
this topic).

It could very well be the case that your tags would not work in the 
future, or even on other current vendors JSP/Servlet Engines. While this 
may not be a concern to you now on your particular project, I would 
advise against it if you want any sort of future reusability. I don't 
think the strategy your seeking to employ is one that was intended by 
the designers of JSP.

just my thoughts on the subject,
Mark
-Ursprüngliche Nachricht-
Von: Mark R. Diggory [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 20. Oktober 2003 15:48
An: Tag Libraries Users List
Betreff: Re: Multiple attributes within an element - Is this a
legal
thingto do?
Sorry, from all my understanding, thats just not allowed in XML. 
Attributes always have to be unique keys. When trying to build
"sets" on 
a "key" I would recommend separate nested tags


 
 
 

You can make a "public Collection getDefineset()" method in the 
DEFINESET tag. Then, in the ELEMENT jsp tag class you can lookup
its 
parent (DEFINESET) and call this method to get the Collection of 
definitions and add any new ELEMENTS to it.

hope this helps some,
MArk
Frank Börncke wrote:

Hello,

defining a custom tag "DEFINESET" in a taglib having an
attribute called ELEMENT we want to use this attribute
multiple times as follows:

  ELEMENT = "x"
  ELEMENT = "y"   
  ELEMENT = "z"
/>

Deployed in a Tomcat environment this results in multiple
calls of the setter 'setELEMENT'. This allows us to collect
the elements in e.g. a HashSet.
Is this multiple usage of an attribute a legal thing to do?
Or is an attribute expected to be used only once in an element
context? I did not find any information concerning this topic.
Will this work in other servlet containers too?

Thanks in advance,

Frank Börncke

__
, Hermann-Lingg-Str. 15, D-80336 München 
[EMAIL PROTECTED]-www.applicate.de 
Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
Fax: + 49 (89) 54 47 9 48 9 

__
, Hermann-Lingg-Str. 15, D-80336 München 
[EMAIL PROTECTED]-www.applicate.de 
Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
Fax: + 49 (89) 54 47 9 48 9 



-

To unsubscribe, e-mail:
[EMAIL PROTECTED]

For additional commands, e-mail:
[EMAIL PROTECTED]


--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multiple attributes within an element - Is this a legal thing to do?

2003-10-20 Thread Mark R. Diggory
Sorry, from all my understanding, thats just not allowed in XML. 
Attributes always have to be unique keys. When trying to build "sets" on 
a "key" I would recommend separate nested tags






You can make a "public Collection getDefineset()" method in the 
DEFINESET tag. Then, in the ELEMENT jsp tag class you can lookup its 
parent (DEFINESET) and call this method to get the Collection of 
definitions and add any new ELEMENTS to it.

hope this helps some,
MArk
Frank Börncke wrote:
Hello,

defining a custom tag "DEFINESET" in a taglib having an
attribute called ELEMENT we want to use this attribute
multiple times as follows:

   ELEMENT = "x"
   ELEMENT = "y"   
   ELEMENT = "z"
/>

Deployed in a Tomcat environment this results in multiple
calls of the setter 'setELEMENT'. This allows us to collect
the elements in e.g. a HashSet.
Is this multiple usage of an attribute a legal thing to do?
Or is an attribute expected to be used only once in an element
context? I did not find any information concerning this topic.
Will this work in other servlet containers too?

Thanks in advance,

Frank Börncke

__
, Hermann-Lingg-Str. 15, D-80336 München 
[EMAIL PROTECTED]-www.applicate.de 
Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
Fax: + 49 (89) 54 47 9 48 9 
 

__
, Hermann-Lingg-Str. 15, D-80336 München 
[EMAIL PROTECTED]-www.applicate.de 
Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
Fax: + 49 (89) 54 47 9 48 9 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Question concerning current nightly buildsof the standard taglibrary.

2003-09-05 Thread Mark R. Diggory
I'm trying to figure out which of these nightly builds to use with 
Tomcat 4.1.x, I'm specifically looking for JSTL 1.0 but both these 
directories seem to contain archives that state they are 1.1?

http://cvs.apache.org/builds/jakarta-taglibs/nightly/projects/standard-1.0/

http://cvs.apache.org/builds/jakarta-taglibs/nightly/projects/standard/

which should I use? Will either work? Will neither work?

-Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: x:transform and body content

2003-09-04 Thread Mark R. Diggory
Yes, that was a foolish re-edit I did before sending the email, in my 
code it is "default", Thanks.

Still, x:transform is picky about the contents of its body even when
 are both defined. A more 
logical and powerful behavior would be to allow other jsp tags to be 
able to exist in  the body no matter if its the "actual xsl content" or 
just parameters.

thanks,
-Mark
[EMAIL PROTECTED] wrote:

You are importing the stylesheet into a variable named "default" as String.
But your x:transform tag does not refer to the variable "default" in which
the stylesheet resides. Instead your x:transform refers to an undeclared
variable called "xslt". Is this really what you want? I suppose you want
 
rather than
 
?


         
"Mark R. Diggory"
<[EMAIL PROTECTED]??:   Tag Libraries Users List <[EMAIL PROTECTED]> 
rvard.edu>cc:
  ??:   x:transform and body content   
2003/09/04 02:54 
"Tag Libraries   
Users List" ???   
?? 
 
 



I'm trying to dynamically set the parameters on an x:transform based on
the params in the http request like below:



   
  
 
  
   

but I keep getting

27: Encountered illegal body of tag "x:transform" tag, given its
attributes.
Is there any way to do this dynamically?

-Mark Diggory

-
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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: x:transform and body content

2003-09-03 Thread Mark R. Diggory
Oh, to clarify my environment: Tomcat 4.1.24, JSTL 1.0.

Mark R. Diggory wrote:

I'm trying to dynamically set the parameters on an x:transform based on 
the params in the http request like below:




  
 

 
  

but I keep getting

27: Encountered illegal body of tag "x:transform" tag, given its 
attributes.

Is there any way to do this dynamically?

-Mark Diggory

-
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]


x:transform and body content

2003-09-03 Thread Mark R. Diggory
I'm trying to dynamically set the parameters on an x:transform based on 
the params in the http request like below:




  
 

 
  

but I keep getting

27: Encountered illegal body of tag "x:transform" tag, given its attributes.

Is there any way to do this dynamically?

-Mark Diggory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[input] questions about status

2003-08-26 Thread Mark R. Diggory
Hi folks,

I'm curious about the status of the input taglibrary, mainly because I 
have my own lib that is called "validation" which acts a wrapper tags 
around form fields to provide user validation for form content (plus 
retention of form field values submitted by user, and conditional logic 
tags to control error display for various fields. It works a bit 
differently than input does.


   
  
   
   

  

 

 
(*) not a valid email.
 
  * You must provide .

  * required.

  

  
 
  
   


This basically provides empty, absent and format checking capabilities 
for request parameters. It uses regexp.jar to to regular expression 
checking.

The powerful feature of this taglibrary is that as "wrappers" there is 
no concern for "presentation" involved with the library, and it can be 
used with more html editors like dream weaver relatively easily.

I'd like to get it working with JSP 2.0, JSTL and multipart file posts 
as well in the near future using either FileUpload or the COS Multipart 
parser package.

Is there any interest in this?
-Mark Diggory
Harvard MIT Data Center
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tag List

2003-02-18 Thread Mark R. Diggory
Just to be clear, I was responding to a user with an interest in 
convering the demo example in the Webservices tutorial into JSLT. A very 
specific and small application. We're on the Taglibs listserv. I saw 
several people tell him to use heavier frameworks external to this 
project. I just wanted to provide him with answer he asked for and could 
"easily do" in one JSP page with JSTL.

***

That said, I agree with you on many points. I have no problem with MVC 
itself, I'll look over maverick more to see if I feel the same way about 
it that I do about Struts.

I primarily struggle with the whole issue of having "too much 
configuration" mapping going on.

1.) I have this great Tomcat JSP Servlet Container that works quite 
elegantly. Like an http server, you know what url's are going to lead to 
your JSP's simply by thier location on the filesystem.  Quite nice, easy 
to use. You've got the Context,Session,Request,Response objects to store 
things in when you need to. Its easy to get used to. And you got custom 
tags to push your model back behind the presentation.

2.) Then you have frameworks like struts that introduce another "level" 
of configuration into the picture. You end up with web.xml and struts 
config.xml files in your web application. You end up tracing through 
them trying to setup all this stuff. What if you want to use Cocoon too, 
now you've got a whole other config to deal with on top of your current 
config. ouch... A whole other realm of complexity.

This is all too much for a small application.


Schnitzer, Jeff wrote:
Aside from that, the main problem with pages that submit back to
themselves is that they confuse the hell out of designers.  My designers
would be bewildered by all that business logic, whether it be in tags or
scriptlets.



Granted that is a "pro" for the use of a framework that breaks the 
presentation off of the model. I would never suggest that is not a 
benifit when you have designers to contend with. Or larger applications 
to work with.

...at which point what you have is a lightweight MVC framework.  In
fact, this is pretty much exactly what Maverick does.  It's what Struts
does too, except that Struts does it with 100 times more code...


Yes, and mine does it simply by using a JSP as Controller instead of a 
bunch of servlets and a config file. A simple solution for his request.


Any webapp of a more than trivial nature ends up with a significant
amount of "framework"; it's just a question of whether you use existing
software or craft your own.  That said, I believe frameworks should be
minimalist, modular, and focused on a narrow goal - which is why my
fellow developers and I gave up on Struts, WebWork, etc and wrote
Maverick.


True...

Cheers :-)
Mark




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tag List

2003-02-17 Thread Mark R. Diggory
No, I just wrote this as a breif example into the email, Some sections 
were not "finished" (ie have ...) I was primarily trying to show a rough 
layout of a jsp that could handle the different conditions that might 
occur in your case example. You'd have to flesh out the sql queries and 
updates.

Therer are some sql:update tags that are left open in the choose block, 
those are probibly causing the nesting error.

Cheers,
Mark


Scott Taylor wrote:
Mark

Am I able to simply overwrite my existing JSP with what you have below?
Because I tried to compile it in Netbeans and got:

ProductList.jsp [-1:-1] End of content reached while more parsing required:
tag nesting error?
Errors compiling ProductList.

Scott

- Original Message -----
From: "Mark R. Diggory" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 9:34 PM
Subject: Re: Tag List




Scott,

Is this kinda what you mean? Are you trying to add the
search/edit/remove/add functionality to the jsp page? This could easily
be captured with forms which submit back to the jsp plus a choose block
to designate which operation is being performed. I bet this'll really
irk those Struts/Maveric MVC folks out there with its use of the JSP
page as both the Controller and View. But it is relatively easy to
accomplish using JSTL without such "heavy" MVC frameworks.

Here is the example:

<%@page contentType="text/html"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"; %>



<%-- conditional logic and sql manipulation --%>

   
   ... sql tags to support the add request
   

   ... sql tags to support the remove request
   
   
   ... sql tags to support the edit request
   


<%-- query to load the html page contents --%>

   
<%-- EXPAND YOUR QUERY WITH SEARCH TERMS HERE --%>
<%--
use some conditional logic on the request
parameters to deside how the query should
be augmented
   --%>
   
   

   
   
   
   SELECT * FROM CD

   


<%-- page with forms to add/edit/remove the contents --%>

CD Catalog List

 CD Catalog List 


 
 
 

 




 
   ID
   CD Title
   Artist
   Country
   Price
   Command
 


 
   
 


 


 





 



   
   
   
  

   
   
 

Add new entry

  
 
 
 
 
 
 






If you want to encapsulate the functions for adding/removing/editing
the content and not have them in this "View/Controller", you could
include them from separate JSP's or Servlets. or likewise submit the
forms directly to those JSP's or Servlets  and then redirect back to
this jsp once the work was done.



It stays pretty independent and light without too much dependency on
any particular framework other than the JSP/JSTL tags. Which results in
less research and development effort  to accomplish the same task. All
you need to know is JSP/JSTL.



-Mark





Eddie Barna wrote:



You can pass the value from your search form to the page which you have
listed in your email.  For example:  You have a search form with a text


box


titled search

Here's what the page that queries the db would look like now






  SELECT * FROM CD WHERE CDTITLE = ?












You can also expand on this by using the OR statement in your query.  For
example:






  SELECT * FROM CD WHERE CDTITLE = ? OR ARTIST = ?













For every condition in your query you must add a  tag.

Hope this helps.  I really do recomend that you get Shawn Bayern's book
titled JSTL in Action.  It explains all this in great detail, plus
everything else.


- Original Message -
From: "Scott Taylor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 14, 2003 9:31 AM
Subject: Tag List






I am trying to find a list of tags to help me modify the CD Shop Cart


web


application from Sun One.

For example, how do I insert tags that provide a search form (and entry
form) rather than simply list everything.

Here is what the code looks like so far:

<%@page contentType="text/html"%>

CD Catalog List
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"; %>

 CD Catalog List 



  SELECT * FROM CD




  ID
  CD Title
  Artist
  Country
  Price




  
  
  
  
  
  
  
">
">
">




  
  






Regards

Scott


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---

Re: Tag List

2003-02-16 Thread Mark R. Diggory
Scott,

Is this kinda what you mean? Are you trying to add the 
search/edit/remove/add functionality to the jsp page? This could easily 
be captured with forms which submit back to the jsp plus a choose block 
to designate which operation is being performed. I bet this'll really 
irk those Struts/Maveric MVC folks out there with its use of the JSP 
page as both the Controller and View. But it is relatively easy to 
accomplish using JSTL without such "heavy" MVC frameworks.

Here is the example:

<%@page contentType="text/html"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"; %>


  url="jdbc:postgresql://localhost:5432/recruitment"
  driver="org.postgresql.Driver"
  user="scott" password="" />

<%-- conditional logic and sql manipulation --%>

   
   ... sql tags to support the add request
   
	
   ... sql tags to support the remove request
   
   
   ... sql tags to support the edit request
   


<%-- query to load the html page contents --%>

   
	<%-- EXPAND YOUR QUERY WITH SEARCH TERMS HERE --%>
	<%-- 
use some conditional logic on the request 
parameters to deside how the query should 
be augmented
   --%>
   
   	
	
   
   
   	
   	SELECT * FROM CD
	
   


<%-- page with forms to add/edit/remove the contents --%>

CD Catalog List

 CD Catalog List 


 	
 	
 	
	
 	
	



 
   ID
   CD Title
   Artist
   Country
   Price
   Command
 


 
   
 	
 	
 	
	
 	
	
   
   
   	
	   
	   
   	
   
 

Add new entry

  
 
 
 
 
 
 






If you want to encapsulate the functions for adding/removing/editing
the content and not have them in this "View/Controller", you could
include them from separate JSP's or Servlets. or likewise submit the
forms directly to those JSP's or Servlets  and then redirect back to
this jsp once the work was done.



It stays pretty independent and light without too much dependency on
any particular framework other than the JSP/JSTL tags. Which results in
less research and development effort  to accomplish the same task. All
you need to know is JSP/JSTL.



-Mark

 


Eddie Barna wrote:


You can pass the value from your search form to the page which you have
listed in your email.  For example:  You have a search form with a text box
titled search

Here's what the page that queries the db would look like now

 


   SELECT * FROM CD WHERE CDTITLE = ?
   


 


   

You can also expand on this by using the OR statement in your query.  For
example:

 


   SELECT * FROM CD WHERE CDTITLE = ? OR ARTIST = ?
   



 


   


For every condition in your query you must add a  tag.

Hope this helps.  I really do recomend that you get Shawn Bayern's book
titled JSTL in Action.  It explains all this in great detail, plus
everything else.


- Original Message -
From: "Scott Taylor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 14, 2003 9:31 AM
Subject: Tag List


 

I am trying to find a list of tags to help me modify the CD Shop Cart web
application from Sun One.

For example, how do I insert tags that provide a search form (and entry
form) rather than simply list everything.

Here is what the code looks like so far:

<%@page contentType="text/html"%>

CD Catalog List
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"; %>

 CD Catalog List 

  url="jdbc:postgresql://localhost:5432/recruitment"
  driver="org.postgresql.Driver"
  user="scott" password="" />


   SELECT * FROM CD



 
   ID
   CD Title
   Artist
   Country
   Price
 


 
   
   
   
   
   
   
   
 ">
 ">
 ">
 

 
   
   
 





Regards

Scott


-
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]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Taglibs and Commons Logging

2002-12-17 Thread Mark R. Diggory
Karr, David wrote


Well, I would guess there's a good reason for that.  The SimpleLog class
just emits to stderr.  Are you not able to see your server console?
 


I just "tail" catalina.out usually to track stuff I'm working on. Or I 
build my own log for a particular webapp if there's too much other 
activity going on there. Right now I think that catalina.out is set to 
be where stderr goes by default in a standard tomcat install on Linux, I 
could be wrong.

Thanks for the help, I hope this info is of some help to others too,
Mark


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Taglibs and Commons Logging

2002-12-17 Thread Mark R. Diggory
Hold on, I made a stupid mistake, my files were named 
commons-logging.properties.properties for some weird reason. It works now.

thanks,
Mark


Mark R. Diggory wrote:

I've been attempting this strategy, but it seems that in the web 
application, somehow the properties files in the classes directory 
don't seem to get recognized by commons logging and used. When I 
compile my tags, they get deployed into jars in the WEB-INF /lib 
directory. I'm concerned that the libs endup on the classpath before 
the properties files, I'm wondering if theres a chance that its not 
searching the whole classpath when seaching for the properties files. 
Am I missing something?

Here's my layout:

/WEB-INF/classes/commons-logging.properties

   
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

/WEB-INF/classes/simplelog.properties

   org.apache.commons.logging.simplelog.defaultlog=trace
   org.apache.commons.logging.simplelog.showdatetime=true

/WEB-INF/lib/commons-logging.jar
/WEB-INF/lib/commons-logging-api.jar
/WEB-INF/lib/mytags.jar

And I don't see any log events in catalina.out for the log.debug(...) 
calls I'm making in my classes.

-Mark

Karr, David wrote:

Struts uses commons-logging.  If you put a "commons-logging.properties"
file in your WEB-INF/classes directory, with the following contents:

org.apache.commons.logging.Log=
org.apache.commons.logging.impl.SimpleLog

Then, you can have a file named "simplelog.properties" in the same
place, with contents like:

org.apache.commons.logging.simplelog.defaultlog= warn

Other systems using commons-logging will probably work the same way.

 

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]

I'm trying to find the best way to integrate commons-logging into my 
taglibs. Do any of the jakarta taglibraries use the Commons API for 
logging? If so, how do you configure the environment so that the 
appropriate logging facility is picked up and used? I'm struggling 
to get the default be the Simple logger, then other Logging 
implementations be used if availble. But I can't see how to do it 
simply within the taglibary/Jatr for my project.

Any tips would be helpfull,
-Mark


--
To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>

  


--
To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>

 





--
To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Taglibs and Commons Logging

2002-12-17 Thread Mark R. Diggory
I've been attempting this strategy, but it seems that in the web 
application, somehow the properties files in the classes directory don't 
seem to get recognized by commons logging and used. When I compile my 
tags, they get deployed into jars in the WEB-INF /lib directory. I'm 
concerned that the libs endup on the classpath before the properties 
files, I'm wondering if theres a chance that its not searching the whole 
classpath when seaching for the properties files. Am I missing something?

Here's my layout:

/WEB-INF/classes/commons-logging.properties

   org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

/WEB-INF/classes/simplelog.properties

   org.apache.commons.logging.simplelog.defaultlog=trace
   org.apache.commons.logging.simplelog.showdatetime=true

/WEB-INF/lib/commons-logging.jar
/WEB-INF/lib/commons-logging-api.jar
/WEB-INF/lib/mytags.jar

And I don't see any log events in catalina.out for the log.debug(...) 
calls I'm making in my classes.

-Mark

Karr, David wrote:

Struts uses commons-logging.  If you put a "commons-logging.properties"
file in your WEB-INF/classes directory, with the following contents:

org.apache.commons.logging.Log	=
org.apache.commons.logging.impl.SimpleLog

Then, you can have a file named "simplelog.properties" in the same
place, with contents like:

org.apache.commons.logging.simplelog.defaultlog	= warn

Other systems using commons-logging will probably work the same way.

 

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]

I'm trying to find the best way to integrate commons-logging into my 
taglibs. Do any of the jakarta taglibraries use the Commons API for 
logging? If so, how do you configure the environment so that the 
appropriate logging facility is picked up and used? I'm struggling to 
get the default be the Simple logger, then other Logging 
implementations 
be used if availble. But I can't see how to do it simply within the 
taglibary/Jatr for my project.

Any tips would be helpfull,
-Mark


--
To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>

   


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

 





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Taglibs and Commons Logging

2002-12-17 Thread Mark R. Diggory
I'm trying to find the best way to integrate commons-logging into my 
taglibs. Do any of the jakarta taglibraries use the Commons API for 
logging? If so, how do you configure the environment so that the 
appropriate logging facility is picked up and used? I'm struggling to 
get the default be the Simple logger, then other Logging implementations 
be used if availble. But I can't see how to do it simply within the 
taglibary/Jatr for my project.

Any tips would be helpfull,
-Mark


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Stuck in Mud... Need your help...

2002-12-16 Thread Mark R. Diggory
Jim Henderson wrote:


Try using just "... extends TagSupport ..." and not BodyTagSupport.  Seems I
had the same problem and went round and round on it.
 

Thanks, yes I went round and round until I came to this conclusion as 
well. I was trying to use EVAL_BODY_BUFFERED with BodyTagSupport and it 
was breaking on Tomcat for what I suspect are other reasons. Then I was 
reading about EVAL_BODY_INCLUDE, I thought that would make the code 
work, I just didn't realize that it would make the BodyContent object 
unavailable for use. I was able to use just TagSupport because my tag 
really just passes the body content through without processing it, I 
have subtags that actually manage what content gets shown or not. I.E.


   
   
   some content which could throw an exception
   
   
   
   
   some code to show if bar is thrown
   
   
   
   
   some code to show if bar2 is thrown
   
   


Cheers,
-Mark

-Original Message-----
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 15, 2002 6:58 PM
To: [EMAIL PROTECTED]
Subject: Stuck in Mud... Need your help...


This is an issue that is not specific to Jakarta Taglibraries, but I
cannot find a relevant location to deal with issues that seem to arise
with different versions of Tomcat and the Implementation of Custom
Taglibraries. (If anyone can recommend a better list to discuss this on
please tell me.

I've got a custom tag that implements a TryCatchFinally interface, its
relatively simple and mirrors the behavior of the Catch tag in JSTL. My
problem is that with the latest version of Tomcat (4.1.12). I am getting
a null BodyContent object from this.getBodyContent();  in the
doAfterBody() method, can anyone tell me why this would be happening?

I don't understand when, where and why BodyContent could end up Null...

Any advice would be helpfull. I've been trying to migrate my
taglibraries (including my new JNDI taglibrary that I was going to
donate to Apache as a "Sandbox" taglibrary). But first I need to get
them upgraded and running properly and this BodyContent issue has been a
major flaw this week.

Tag Class:

package edu.harvard.hmdc.taglib.conditional;

import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.IterationTag;
import javax.servlet.jsp.tagext.BodyTag;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.ServletRequest;
import java.io.PrintWriter;
import java.io.IOException;

import java.util.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *  Generated tag class.
 */
public class TestTag extends BodyTagSupport implements
javax.servlet.jsp.tagext.TryCatchFinally{

/** Log object for this class. */
private Log log = null;

public TestTag() {
super();
log = LogFactory.getLog(this.getClass());
log.debug("log enabled in Get Tag");
}


public int doStartTag() throws JspException, JspException {
return EVAL_BODY_INCLUDE;

}

public int doEndTag() throws JspException, JspException {
return EVAL_PAGE;
}

public int doAfterBody() throws JspException {
try {
BodyContent bodyContent = getBodyContent();
JspWriter out = bodyContent.getEnclosingWriter();

bodyContent.writeOut(out);
bodyContent.clearBody();

} catch (IOException ex) {
log.error(ex.getMessage(),ex);
}

return SKIP_BODY;
}

public void doCatch(Throwable t) throws Throwable {
   log.debug("doCatch(Throwable t)");
   log.debug("t="+t.getClass().getName());
   //throw t;
}


public void doFinally() {
log.debug("doFinally()");
}

}


JSP Example:


	
	<%
if(request.getParameter("throw") != null){
throw new java.lang.Exception("Message from Exception");
}
%>
	Successfully completed test block without exception.



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

 





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




[OT reply to] Re: Stuck in Mud... Need your help...

2002-12-16 Thread Mark R. Diggory
IMHO, its actually quite simple (I know this is the wrong list for this 
discussion so, I'll mark it "OT")..

1.) If I were working with a tag that I wanted to manipulate the body 
content of, I would use the BodyTag Interface and the provided 
BodyTagSupport. The relevant Constants in the Interface are

BodyTag: 
	EVAL_BODY_BUFFERED (to get hold of the BodyContent object and appropriate JspWriter)
	SKIP_BODY (to tell the Jsp Engine ignore the body)


2.) If I were working on a tag that I just wanted the engine to manage the body I would use the Tag Interace and the provided TagSupport. The relevant constants would be 

Tag:
	EVAL_BODY_INCLUDE (to tell the Jsp Engine include the body)
	SKIP_BODY (to tell the Jsp Engine ignore the body)


Now, its not really that logical to me to apply any case where I would want to use BodyTag/BodyTagSupport and use the constant "EVAL_BODY_INCLUDE" when all the functionality for that case is already well defined in the Tag/TagSupport interface, because of this providing EVAL_BODY_INCLUDE in a BodyTag is just confusing the issue, why would you use a BodyTag if you didn't want to get hold of the BodyContent? This is why it seems silly to me. I spent a good amount of time trying to understand my mistake of doing this. Now, if the interface enforced "not" doing this, the problem would have never arisen. 


You either want the Body or you don't, the nature of how the body is processed should be the buisness of the Interface/Implementation (Tag or BodyTag). I think exposing an alternate EVAL_BODY_INCLUDE/BUFFERED optionality breaks that Interface functionality encapsulation. Because now you have BodyTags doing what Tags was supposed to do in the long run.

Of course, I could be completely missing something here, which I'm sure our peers will gladly stand up and point out (and which I will take pleasure in finding out about).


Cheers (and Happy Holidays),
-Mark


Karr, David wrote:

The return value from "doStartTag()" can have three (more?) different
return values, being EVAL_BODY_INCLUDE, EVAL_BODY_BUFFERED, or
SKIP_BODY.

I don't see how the difference is "silly".  It was a good idea to
separate them, so tags which don't need to manipulate their body can be
more efficient.

 

-Original Message-
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]

Thanks, yes that appeared to be it. I'm always running into 
this "silly" 
issue of TagSupport vs. BodyTagSupport and the difference in 
the constants.

TagSupport --> EVAL_BODY_INCLUDE or SKIP_BODY

BodyTagSupport --> EVAL_BODY_BUFFERED or SKIP_BODY

Seems that the JSP Taglib spec has alot of this use of 
constant ints in 
situations where boolean return values would do just fine and save on 
the confusion. But thats a different issue for a different list... ;-)
   


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

 





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Stuck in Mud... Need your help...

2002-12-16 Thread Mark R. Diggory
Thanks, yes that appeared to be it. I'm always running into this "silly" 
issue of TagSupport vs. BodyTagSupport and the difference in the constants.

TagSupport --> EVAL_BODY_INCLUDE or SKIP_BODY

BodyTagSupport --> EVAL_BODY_BUFFERED or SKIP_BODY

Seems that the JSP Taglib spec has alot of this use of constant ints in 
situations where boolean return values would do just fine and save on 
the confusion. But thats a different issue for a different list... ;-)

-Thank you for reviewing the code.
Mark

Christopher Lenz wrote:
Hi Mark,
see below



public int doStartTag() throws JspException, JspException {
return EVAL_BODY_INCLUDE;

}



If I'm not totally confused, this should be EVAL_BODY_BUFFERED if you 
want to have the BodyContent set on the tag.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Stuck in Mud... Need your help...

2002-12-15 Thread Mark R. Diggory
Also here is the descriptor:


test
 edu.harvard.hmdc.taglib.conditional.TestTag
JSP
test
test




Mark R. Diggory wrote:

This is an issue that is not specific to Jakarta Taglibraries, but I 
cannot find a relevant location to deal with issues that seem to arise 
with different versions of Tomcat and the Implementation of Custom 
Taglibraries. (If anyone can recommend a better list to discuss this on 
please tell me.

I've got a custom tag that implements a TryCatchFinally interface, its 
relatively simple and mirrors the behavior of the Catch tag in JSTL. My 
problem is that with the latest version of Tomcat (4.1.12). I am getting 
a null BodyContent object from this.getBodyContent();  in the 
doAfterBody() method, can anyone tell me why this would be happening?

I don't understand when, where and why BodyContent could end up Null...

Any advice would be helpfull. I've been trying to migrate my 
taglibraries (including my new JNDI taglibrary that I was going to 
donate to Apache as a "Sandbox" taglibrary). But first I need to get 
them upgraded and running properly and this BodyContent issue has been a 
major flaw this week.

Tag Class:

package edu.harvard.hmdc.taglib.conditional;

import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.IterationTag;
import javax.servlet.jsp.tagext.BodyTag;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.ServletRequest;
import java.io.PrintWriter;
import java.io.IOException;

import java.util.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *  Generated tag class.
 */
public class TestTag extends BodyTagSupport implements 
javax.servlet.jsp.tagext.TryCatchFinally{

/** Log object for this class. */
private Log log = null;

public TestTag() {
super();
log = LogFactory.getLog(this.getClass());
log.debug("log enabled in Get Tag");
}


public int doStartTag() throws JspException, JspException {
return EVAL_BODY_INCLUDE;

}

public int doEndTag() throws JspException, JspException {
return EVAL_PAGE;
}

public int doAfterBody() throws JspException {
try {
BodyContent bodyContent = getBodyContent();
JspWriter out = bodyContent.getEnclosingWriter();

bodyContent.writeOut(out);
bodyContent.clearBody();

} catch (IOException ex) {
log.error(ex.getMessage(),ex);
}

return SKIP_BODY;
}

public void doCatch(Throwable t) throws Throwable {
   log.debug("doCatch(Throwable t)");
   log.debug("t="+t.getClass().getName());
   //throw t;
}


public void doFinally() {
log.debug("doFinally()");
}

}


JSP Example:



<%
if(request.getParameter("throw") != null){
throw new java.lang.Exception("Message from Exception");
}
%>
Successfully completed test block without exception.



--
To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Stuck in Mud... Need your help...

2002-12-15 Thread Mark R. Diggory
This is an issue that is not specific to Jakarta Taglibraries, but I 
cannot find a relevant location to deal with issues that seem to arise 
with different versions of Tomcat and the Implementation of Custom 
Taglibraries. (If anyone can recommend a better list to discuss this on 
please tell me.

I've got a custom tag that implements a TryCatchFinally interface, its 
relatively simple and mirrors the behavior of the Catch tag in JSTL. My 
problem is that with the latest version of Tomcat (4.1.12). I am getting 
a null BodyContent object from this.getBodyContent();  in the 
doAfterBody() method, can anyone tell me why this would be happening?

I don't understand when, where and why BodyContent could end up Null...

Any advice would be helpfull. I've been trying to migrate my 
taglibraries (including my new JNDI taglibrary that I was going to 
donate to Apache as a "Sandbox" taglibrary). But first I need to get 
them upgraded and running properly and this BodyContent issue has been a 
major flaw this week.

Tag Class:

package edu.harvard.hmdc.taglib.conditional;

import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.IterationTag;
import javax.servlet.jsp.tagext.BodyTag;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.ServletRequest;
import java.io.PrintWriter;
import java.io.IOException;

import java.util.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *  Generated tag class.
 */
public class TestTag extends BodyTagSupport implements 
javax.servlet.jsp.tagext.TryCatchFinally{

/** Log object for this class. */
private Log log = null;

public TestTag() {
super();
log = LogFactory.getLog(this.getClass());
log.debug("log enabled in Get Tag");
}


public int doStartTag() throws JspException, JspException {
return EVAL_BODY_INCLUDE;

}

public int doEndTag() throws JspException, JspException {
return EVAL_PAGE;
}

public int doAfterBody() throws JspException {
try {
BodyContent bodyContent = getBodyContent();
JspWriter out = bodyContent.getEnclosingWriter();

bodyContent.writeOut(out);
bodyContent.clearBody();

} catch (IOException ex) {
log.error(ex.getMessage(),ex);
}

return SKIP_BODY;
}

public void doCatch(Throwable t) throws Throwable {
   log.debug("doCatch(Throwable t)");
   log.debug("t="+t.getClass().getName());
   //throw t;
}


public void doFinally() {
log.debug("doFinally()");
}

}


JSP Example:


	
	<%
if(request.getParameter("throw") != null){
throw new java.lang.Exception("Message from Exception");
}
%>
	Successfully completed test block without exception.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Custom taglib Exception with Tomcat 4.1

2002-12-11 Thread Mark R. Diggory
I have some old custom taglibs I've written that worked with tomcat 
4.0.* and I'm trying to migrate them to tomcat 4.1.*. I've encountered 
the following exception in tomcat and I'm a little stumped as towhat it 
means, does anyone have an tips as to what this exception is about?

-thanks,
Mark


2002-12-11 18:08:59 StandardWrapperValve[jsp]: Servlet.service() for 
servlet jsp threw exception
org.apache.jasper.JasperException: /Layout/LayoutTemplate.jsp(0,0) 
jsp.error.buffer.invalid
   at 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(Unknown Source)
   at org.apache.jasper.compiler.ErrorDispatcher.dispatch(Unknown 
Source)
   at org.apache.jasper.compiler.ErrorDispatcher.jspError(Unknown 
Source)
   at 
org.apache.jasper.compiler.Validator$PageDirectiveVisitor.visit(Unknown 
Source)
   at org.apache.jasper.compiler.Node$PageDirective.accept(Unknown 
Source)
   at org.apache.jasper.compiler.Node$Nodes.visit(Unknown Source)
   at org.apache.jasper.compiler.Node$Visitor.visitBody(Unknown Source)
   at org.apache.jasper.compiler.Node$Visitor.visit(Unknown Source)
   at org.apache.jasper.compiler.Node$Root.accept(Unknown Source)
   at org.apache.jasper.compiler.Node$Nodes.visit(Unknown Source)
   at org.apache.jasper.compiler.Validator.validate(Unknown Source)
   at org.apache.jasper.compiler.Compiler.generateJava(Unknown Source)
   at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
   at org.apache.jasper.JspCompilationContext.compile(Unknown Source)
   at org.apache.jasper.servlet.JspServletWrapper.service(Unknown 
Source)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown 
Source)
   at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown 
Source)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
   at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown 
Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
   at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
   at org.apache.catalina.core.StandardContextValve.invoke(Unknown 
Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
   at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
   at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
   at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown 
Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
   at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
   at org.apache.catalina.core.StandardEngineValve.invoke(Unknown 
Source)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
Source)
   at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
   at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
   at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
   at java.lang.Thread.run(Thread.java:536)



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Tag for uploading

2002-11-07 Thread Mark R. Diggory
Stefan wrote:


My 2 cents.

Please no flames, I'm just a poor little geek! :)

Stefan
 

I'm certainly not against speaking ones mind! ;-)  I'm sure .NET is here 
to stay as well. It certainly doesn't hurt to have alot of tools in your 
tool box.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Tag for uploading

2002-11-07 Thread Mark R. Diggory
To get back to Taglibraries. I've gotten away with using "cos" embeded 
in Java Scriptlets inside my JSP's, It is not out of the realm of 
possiblity to see One developing a Multipart File Upload taglibrary of 
sorts if one wanted it. If when the POST requests encoding type is 
determined to not be "some default" it does not parse the post body, 
then parsing the body can occur just about anywhere in the process.


Donald Ball wrote:

[OT, I realize, my last word on the subject]
 

Ok, then here's my last words on this as well..


 

Jason's classes aren't free software, they're encumbered by a "buy lots
   

of
   

copies of my book" license.
  

   

These days does one really need a lawyer to define *free*. You can 
download the code and look at it, compile it and distribute it in your 
project if you’re non-commercial. Obviously there are no restrictions on
   


 

building a decent package with similar capabilities if your working on a 
Commercial project. Besides, if you work for a *Commercial Institution*, 
I'm sure they'd be glad to buy you one stupid little book so you can 
meet the licensing requirements. For a private commercial entity, maybe 
that’s better than having to release all your code to the world to meet 
the requirements of a GNU license. Really, how *one* decides to package 
and publish their code is really their business. Nobody said *Open 
source* was the *only* way you can go when it comes to exposing the code 
of your software.
   


1. Jason's license requires every member of the development team to own a
copy of the latest version of his book. Expense aside, that's a lot of dead
trees and a very silly license.
 

I guess I miss-read that preamble. I doubt such a silly license would 
hold up very well in court ;-)

2. Free does not necessarily imply GPL. Most of us in the Apache software
community tend towards BSD-type licenses.
 

I was just using GPL as an example of a Opensource style license. Note: 
We use a GPL license on our code, But I think its rather weak to 
enforce. Plus, I wonder to myself, if anyone has ever been taken to 
court for violating an Opensource License?

 

I agree that if one wants to see a particular change one can get 
involved. That’s the power of "Community". But, I think its right that 
this would clutter up an already well-defined "spec". It seems a stable 
and well organized set of requirements for managing "basic 
webapplication request/response" transactions. I mean, good packages do 
"one thing" and do that "one thing" very well.
   


Would you agree that the cookie handling code is cluttering up the spec?
After all, you can manually parse and generate your own cookie header
string. 

I guess I'd draw the line on what the Servlet API should provide from 
the HTTP Spec. If the SPEC defines multipart enc type. Then perhapse the 
Servlet HTTP Api *should* support parsing it. But, I don't have the spec 
handy so I couldn't tell you.

Conversely, would you agree that the servlet API would be
incomplete if servlet containers weren't required to parse POST requests
for you? You can manually parse the POST requests yourself, but there is
considerable benefit to be realized by centralizing that code. I think the
same argument applies for parsing multipart/form-data request bodies.
 

This is a grey area because GET/POST are methods and mutlipart/form-data 
is an encoding-type. Supporting the "default" encoding type for a POST 
probibly makes sense as it is used so much, should the API support other 
possible encoding tyes as well? Or should it provide the ability to 
support other encoding types through extensibility mechanisms? (I.E. 
Wrappers). Simply including wrappers for these features (i.e. something 
like cos) and alowing one to turn them on and off (filters/web.xml 
config) is more flexible than enforcing a specific API for the behavior.

diversity that makes for the ultimate flexibility and ultimate 
interoperability. By not restricting the file upload functionality into 
an API, it leaves it open for competitive open source development (In 
reality, I just wish JCP had done the same for the HttpSession API).
   


??? The API just defines an interface which programmers who want to develop
portable applications can use. The implementations of the interface can
compete, proprietary, open source, what have you. And still, people who
don't like the API can develop their own superior API (SAX, anyone?) and
use that. Nothing forces you to use the session API; you're free to write
your own and use it if you like.
 

true, but default sessioning is pretty heavily integrated into the 
Servlet API. In using the API I sometimes wish if didn't "restrict" its 
functionality the way it does. I.E. I'd like to be able to control the 
name of my session Id's myself, but the SPEC says they have to be keyed 
JSESSIONID). I could build or go find an API that allows me to do this. 
But then my developers would be confused as to which session they are 

Re: Tag for uploading

2002-11-07 Thread Mark R. Diggory
Please Note, This is all in good taste! ;-) Just fueling the fires of 
debate.

-Mark


Mark R. Diggory wrote:

Sorry, I just got to get in on this!

Stefan wrote:


Well I know one thing for sure, uploading files is standard 'out of 
the box'
with ASP.net. That is one thing that makes me scratch my head about 
the Java
platform, there are many common things that are used constantly in web
programming that are not directly addressed in a reasonable manner:

Uploading files
Simple implementation of JavaMail (I used Java mail as is but a facade
should have been put in place on top of it.)
Paging of collections
Rich Calendar
Client and server side validations
Auto-formatting of collections on the page.
Keeping state of form widgets

etc...
 

I know some if not all are being addressed in various places, I just 
would
have thought that SUN and the JCP would have had this stuff out 
already as
part of the core features of Java. Now we have to run all over the 
place to
put stuff together ...

This is especially interesting when all this is addressed in the 
competition
(.NET) for well over a year (Beta 2 had all this and Beta 2 is pretty
representative of the final release.)
 

I think that’s because we Java Programmers like to *know* the code of 
the packages we are working with and not rely on some proprietary 
*black box* that Microsloth is trying to *shove in our face*.

Just my two cents.

Stef

- Original Message -
From: "Donald Ball" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 10:27 AM
Subject: Re: Tag for uploading
 

It's been discussed to add it to the Servlet spec a few times, but it
gets shut down every time because it's not obvious how it should look
like to handle all possible requirements and still be easier to use
than one of the existing "third-party solutions" (like Jason's filter
and parsing classes). For instance, how to deal with large files 
(reject
them or store them in a file?), how to get access to regular 
parameters,
how to get access to the files (InputStream or File?), how to set
limits, download directory, etc, etc.


Jason's classes aren't free software, they're encumbered by a "buy 
lots of
copies of my book" license.
  


These days does one really need a lawyer to define *free*. You can 
download the code and look at it, compile it and distribute it in your 
project if you’re non-commercial. Obviously there are no restrictions 
on building a decent package with similar capabilities if your working 
on a Commercial project. Besides, if you work for a *Commercial 
Institution*, I'm sure they'd be glad to buy you one stupid little 
book so you can meet the licensing requirements. For a private 
commercial entity, maybe that’s better than having to release all your 
code to the world to meet the requirements of a GNU license. Really, 
how *one* decides to package and publish their code is really their 
business. Nobody said *Open source* was the *only* way you can go when 
it comes to exposing the code of your software.

It's not impossible to come up with answers to all of these questions,
but so far the opinion of the spec group has been that existing
third-party solutions are sufficient and that very little would be
gained by adding it to the spec (in fact, it would make the spec more
complex, and arguable file upload is not in scope for the servlet 
spec).


Nothing but the ability to code java webapps that handle file 
uploads in an implementation-independent fashion.

  

If you feel strongly about it, I suggest you send it as a suggestion
to the spec group.


I strongly encourage people to do so. This situation won't change unless
many people write in and complain.

- donald
  


I agree that if one wants to see a particular change one can get 
involved. That’s the power of "Community". But, I think its right that 
this would clutter up an already well-defined "spec". It seems a 
stable and well organized set of requirements for managing "basic 
webapplication request/response" transactions. I mean, good packages 
do "one thing" and do that "one thing" very well.

Plus, its sounds like you are trying to change a standard because 
everything you wanted wasn't "spoon fed" to you, or because you don't 
want to get off your butt and learn to tie together a set of already 
existing, community developed, tools that each do their job very well. 
Isn't this that "Community Process" that Microsloth CEO Steve Balmer 
was ranting was the "Open Source Enemy" several months ago, and then 
turned on his coat tails and started crying, "We need to embrace the 
Community!" The whole point of community is that no *one* entity has 
the monopoly on the code! No one entity defines all the standards! 
It’s this diversity that makes for 

Re: Tag for uploading

2002-11-07 Thread Mark R. Diggory
Sorry, I just got to get in on this!

Stefan wrote:


Well I know one thing for sure, uploading files is standard 'out of the box'
with ASP.net. That is one thing that makes me scratch my head about the Java
platform, there are many common things that are used constantly in web
programming that are not directly addressed in a reasonable manner:

Uploading files
Simple implementation of JavaMail (I used Java mail as is but a facade
should have been put in place on top of it.)
Paging of collections
Rich Calendar
Client and server side validations
Auto-formatting of collections on the page.
Keeping state of form widgets

etc...
 

I know some if not all are being addressed in various places, I just would
have thought that SUN and the JCP would have had this stuff out already as
part of the core features of Java. Now we have to run all over the place to
put stuff together ...

This is especially interesting when all this is addressed in the competition
(.NET) for well over a year (Beta 2 had all this and Beta 2 is pretty
representative of the final release.)
 

I think that’s because we Java Programmers like to *know* the code of 
the packages we are working with and not rely on some proprietary *black 
box* that Microsloth is trying to *shove in our face*.

Just my two cents.

Stef

- Original Message -
From: "Donald Ball" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 10:27 AM
Subject: Re: Tag for uploading
 

It's been discussed to add it to the Servlet spec a few times, but it
gets shut down every time because it's not obvious how it should look
like to handle all possible requirements and still be easier to use
than one of the existing "third-party solutions" (like Jason's filter
and parsing classes). For instance, how to deal with large files (reject
them or store them in a file?), how to get access to regular parameters,
how to get access to the files (InputStream or File?), how to set
limits, download directory, etc, etc.
 

Jason's classes aren't free software, they're encumbered by a "buy lots of
copies of my book" license.
   

These days does one really need a lawyer to define *free*. You can 
download the code and look at it, compile it and distribute it in your 
project if you’re non-commercial. Obviously there are no restrictions on 
building a decent package with similar capabilities if your working on a 
Commercial project. Besides, if you work for a *Commercial Institution*, 
I'm sure they'd be glad to buy you one stupid little book so you can 
meet the licensing requirements. For a private commercial entity, maybe 
that’s better than having to release all your code to the world to meet 
the requirements of a GNU license. Really, how *one* decides to package 
and publish their code is really their business. Nobody said *Open 
source* was the *only* way you can go when it comes to exposing the code 
of your software.

It's not impossible to come up with answers to all of these questions,
but so far the opinion of the spec group has been that existing
third-party solutions are sufficient and that very little would be
gained by adding it to the spec (in fact, it would make the spec more
complex, and arguable file upload is not in scope for the servlet spec).
 

Nothing but the ability to code java webapps that handle file uploads in an implementation-independent fashion.

   

If you feel strongly about it, I suggest you send it as a suggestion
to the spec group.
 

I strongly encourage people to do so. This situation won't change unless
many people write in and complain.

- donald
   

I agree that if one wants to see a particular change one can get 
involved. That’s the power of "Community". But, I think its right that 
this would clutter up an already well-defined "spec". It seems a stable 
and well organized set of requirements for managing "basic 
webapplication request/response" transactions. I mean, good packages do 
"one thing" and do that "one thing" very well.

Plus, its sounds like you are trying to change a standard because 
everything you wanted wasn't "spoon fed" to you, or because you don't 
want to get off your butt and learn to tie together a set of already 
existing, community developed, tools that each do their job very well. 
Isn't this that "Community Process" that Microsloth CEO Steve Balmer was 
ranting was the "Open Source Enemy" several months ago, and then turned 
on his coat tails and started crying, "We need to embrace the 
Community!" The whole point of community is that no *one* entity has the 
monopoly on the code! No one entity defines all the standards! It’s this 
diversity that makes for the ultimate flexibility and ultimate 
interoperability. By not restricting the file upload functionality into 
an API, it leaves it open for competitive open source development (In 
reality, I just wish JCP had done the same for the HttpSession API).

my 3 cents
Mark




--
To unsubscribe, e-mail:   

Re: Designing Good Objects for EL

2002-09-03 Thread Mark R. Diggory

Karr, David wrote:

>
>You'll just have to wait like the rest of us :) .
>  
>
Yes, quite true.

>Others can provide more detailed information here, but basically it's not
>there yet.  I think it's clear that we'll eventually get access to
>Collection API methods, or more general access to object methods, through
>the EL, but not yet.  As we provide/get more useful features in systems, we
>always see "the next logical step", which is what happened here.
>
>It would be worthwhile, for us as individuals, to investigate what is
>provided in the EL and consider experimenting with how we could extend the
>API, or integrate with it, to provide features like this, so we can better
>understand it when it comes, or even participate in the development itself.
>
I have found the JCP for JSTL and some documentation on EL here:
http://www.jcp.org/jsr/detail/52.jsp

-Mark



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Designing Good Objects for EL

2002-09-03 Thread Mark R. Diggory

Ugh,

I've been plagued with issues that have to do with EL and accessing 
Attributes/Properties in Objects. It turns out that the following is a 
very big issue:

1.) Objects that extend or implment java.util.Collection api will always 
revert to that api when you try to access them using EL.

for example:
if an object extends HashMap and has both the method 'get(Object o)' 
and the method 'getFooBar()' EL will try to use the 'get("fooBar")' 
method for 'object.fooBar' and not call getFooBar() so Collection 
objects can only be Collection objects and JavaBeans can only be 
JavaBeans. They cannot be mixed.

2.) JavaBeans specs limit what an Object can contain in terms of 
methods. I always disliked that they haven't made JavaBeans any 
"smarter" than "get/set" I'm always wanting to do things like 
"add/remove". Really!, whats the use of the Collections API if I'm 
always stuck converting Collections to Object[]'s just to spit them in 
and out through the JavaBean Api.

This is tough in JSTL

if I want to call a non-bean method I have to get my own reference 
to the object and use that <% 
((ObjectCast)pageContext.getAttribute("fooBar")).method(); %>

Finally,

Does EL have capabilities for "Indexed" JavaBean patterns? I can't find 
any online documentation on this?

-Mark




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: AW: Is there tools for Jsp development ?

2002-09-03 Thread Mark R. Diggory

Sun ONE Studio

http://wwws.sun.com/software/sundev/jde/index.html

for all my Webapplication / JSP needs. You can role your own taglibs in 
One and even test your webapplications on an internal installation of 
Tomcat 4.0.

-Mark

 marba wrote:

>I use dreamweaver mx which support jsp & taglibs, even if sometimes crashes
>(!)
>
>- Original Message -
>From: "Thomas Colin de Verdière" <[EMAIL PROTECTED]>
>To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
>Sent: Monday, September 02, 2002 7:09 PM
>Subject: Re: AW: Is there tools for Jsp development ?
>
>
>  
>
>>Thanks,
>>i thought it was wysiwyg , so there is no wysiwyg tools for developing
>>
>>
>Jsp?
>  
>
>>Dimitrios Venizeleas wrote:
>>
>>
>>>I use Forte4J Community Edition
>>>
>>>Dimitris
>>>
>>>
>>>  
>>>
-Ursprüngliche Nachricht-
Von: Thomas Colin de Verdière [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 2. September 2002 11:52
An: Tag Libraries Users List
Betreff: Is there tools for Jsp development ?


Hi,
Is there some tools for wysiwyg Jsp development using bean or tag


>library?
>  
>
--
Thomas Colin de Verdière


--
To unsubscribe, e-mail:

For additional commands, e-mail:





>>>
>>>--
>>>To unsubscribe, e-mail:
>>>  
>>>
>
>  
>
>>>For additional commands, e-mail:
>>>  
>>>
>
>  
>
>>>
>>>  
>>>
>>--
>>Thomas Colin de Verdière
>>SCORT
>>http://www.scort.com
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
>>
>
>  
>
>>For additional commands, e-mail:
>>
>>
>
>  
>
>>
>>
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>  
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JSP 2.0 and EL

2002-08-31 Thread Mark R. Diggory

Very cool, this was a long time needed in JSP. I'm looking forward to this.

Cheers,
Mark


Shawn Bayern wrote:

>On Sat, 31 Aug 2002, Mark R. Diggory wrote:
>
>  
>
>>So, I'm wondering, if EL is going to be available in the JSP 2.0 Core. 
>>Does this mean the following?
>>
>>1.) Most taglibs for JSP 2.0 will be able to adopt to EL without much in 
>>the line of code modifications?
>>
>>i.e.
>>
>>
>>
>>could easily be rewritten as
>>
>>
>>
>>
>
>Yes, exactly.  The tag doesn't need to know whether the page author used
>an rtexprvalue or the EL.
>
>  
>
>>and the setting of the "Attribute" would be independent of the
>>evaluation of this would be independent of ${sessionScope.foobar}in
>>the taglib?
>>
>>
>
>Sorry, I'm afriad I don't understand what you're asking here.  But
>${sessionScope.foobar} gets evaluated by the container under JSP 2.0, not
>by the tag; the tag need not use the EL API itself.
>
>  
>
>>2.) Will we be able to do things like this?
>>
>>An example of EL outside of a custom 
>>tag. 
>>
>>
>
>Yup - or in plain template text too, as in
>
>  
>   What were you thinking
>   when you ordered
>   ${number} gallons of yogurt?
>  
>
>  
>
>>I have some some custom taglib's I've been working on, I was thinking
>>of integrating the EL Engine from JSTL into them and now, if the above
>>is true, I'm wondering if I really have to do that? Or if I should
>>just focus on implementing them for JSP 2.0.
>>
>>
>
>It's just a matter of timing.  If you want to use the EL today, you should
>probably call the evaluator yourself.  But if you can wait a few months,
>then the need goes away because JSP 2.0 takes care of the problem for you.
>
>  
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




JSP 2.0 and EL

2002-08-31 Thread Mark R. Diggory

So, I'm wondering, if EL is going to be available in the JSP 2.0 Core. 
Does this mean the following?

1.) Most taglibs for JSP 2.0 will be able to adopt to EL without much in 
the line of code modifications?

i.e.



could easily be rewritten as



and the setting of the "Attribute" would be independent of the 
evaluation of this would be independent of ${sessionScope.foobar}in the 
taglib?

2.) Will we be able to do things like this?

An example of EL outside of a custom 
tag. 

I have some some custom taglib's I've been working on, I was thinking of 
integrating the EL Engine from JSTL into them and now, if the above is 
true, I'm wondering if I really have to do that? Or if I should just 
focus on implementing them for JSP 2.0.

-Mark Diggory
Harvard MIT Data Center
http://thedata.org/





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Again! Location of JSP page the Taglib is executing in (reallyStuck on this one, PLEASE HELP).

2002-08-28 Thread Mark R. Diggory

Maybe this discussion would be more appropriate on the main 
Tomcat/Catalina list. I'll post it there instead.

Mark R. Diggory wrote:

> This gives me an interesting URL in return, I assume this is out of 
> Tomcats JNDI Context.
>
> <%java.net.URL theUrl = 
> pageContext.getServletContext().getResource("/");%>
> <%=theUrl.toString()%>
>
> returns
>
> jndi:/localhost/Taglib/
>
> Not quite there, Is there a way to get
>
> Tim Kettering wrote:
>
>> Um, this code snippet is in one of my servlets, not a JSP page, but 
>> however,
>> since JSP pages do get compiled to servlets, this might be a clue to an
>> solution for you?
>>
>> There may be a more efficient way to do this, but this works 
>> perfectly fine
>> for me for determining where the root directory of the 
>> web-application is on
>> the physical server drive.
>>
>>URL theUrl = sc.getResource("/");
>>String webapp_base_dir = theUrl.getFile();
>>return webapp_base_dir;
>>
>>
>>
>>  
>>
>>> I really can't get to the bottom of this one.
>>>
>>> Is there any way to get to the "TRUE" filesystem location of the JSP
>>> page I am within? Even if the URI is Mapped through ServletMapping like
>>> below? I've tried getRealPath(...) and this is not accurate on the
>>> Tomcat 4.0.3 version I'm currently using.
>>>
>>> I need to get
>>>
>>> /var/tomcat4/webapps/Jaxp/JSPTransformExample.jsp (which really 
>>> exists!)
>>>
>>> not
>>>
>>> /var/tomcat4/webapps/Jaxp/MapExample.jsp (which is virtual and doesn't
>>> exist!)
>>>
>>>   
>>>
>>>> 
>>>>   JSPTestMap
>>>>   /Jaxp/JSPTransformExample.jsp
>>>> 
>>>> 
>>>>   JSPTestMap
>>>>   /Jaxp/MapExample.jsp
>>>> 
>>>> 
>>>
>>> -Mark Diggory
>>>
>>>
>>>
>>> -- 
>>> To unsubscribe, e-mail:   
>>> <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail: 
>>> <mailto:[EMAIL PROTECTED]>
>>>
>>>   
>>
>>
>>  
>>
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Again! Location of JSP page the Taglib is executing in (reallyStuck on this one, PLEASE HELP).

2002-08-28 Thread Mark R. Diggory

This gives me an interesting URL in return, I assume this is out of 
Tomcats JNDI Context.

<%java.net.URL theUrl = pageContext.getServletContext().getResource("/");%>
<%=theUrl.toString()%>

returns

jndi:/localhost/Taglib/

Not quite there, Is there a way to get

Tim Kettering wrote:

>Um, this code snippet is in one of my servlets, not a JSP page, but however,
>since JSP pages do get compiled to servlets, this might be a clue to an
>solution for you?
>
>There may be a more efficient way to do this, but this works perfectly fine
>for me for determining where the root directory of the web-application is on
>the physical server drive.
>
>URL theUrl = sc.getResource("/");
>String webapp_base_dir = theUrl.getFile();
>return webapp_base_dir;
>
>
>
>  
>
>>I really can't get to the bottom of this one.
>>
>>Is there any way to get to the "TRUE" filesystem location of the JSP
>>page I am within? Even if the URI is Mapped through ServletMapping like
>>below? I've tried getRealPath(...) and this is not accurate on the
>>Tomcat 4.0.3 version I'm currently using.
>>
>>I need to get
>>
>>/var/tomcat4/webapps/Jaxp/JSPTransformExample.jsp (which really exists!)
>>
>>not
>>
>>/var/tomcat4/webapps/Jaxp/MapExample.jsp (which is virtual and doesn't
>>exist!)
>>
>>
>>
>>> 
>>>   JSPTestMap
>>>   /Jaxp/JSPTransformExample.jsp
>>> 
>>> 
>>>   JSPTestMap
>>>   /Jaxp/MapExample.jsp
>>> 
>>>  
>>>
>>-Mark Diggory
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   
>>For additional commands, e-mail: 
>>
>>
>>
>
>  
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Again! Location of JSP page the Taglib is executing in (reallyStuck on this one, PLEASE HELP).

2002-08-28 Thread Mark R. Diggory

I want my taglib to be able to resolve files relative to the jsp page 
its within. Unfortunately, the servlet-mapping seems to get in the way 
of this. I thought Tim's response was interesting so I tried it but I'm 
getting wierd responses (jndi: contexts) instead of filesystems. I'm 
thinking, is there a way to get at the resources relative to a JSP using 
the JNDI Context?

-Mark





Shawn Bayern wrote:

>Interestingly enough, I'm inclined to think the answer is "no."  Even if
>there's some creative way of doing it that eludes me, you're still not
>even guaranteed to *have* a filesystem at runtime.  So at best, a solution
>would be implementation-specific or container-specific.
>
>What do you need this information for?  There might be another way of
>doing it -- or, at worst, it might be enough to simply add some static,
>context-initialization parameters that supply the information you need.
>
>Shawn
>
>On Wed, 28 Aug 2002, Mark R. Diggory wrote:
>
>  
>
>>I really can't get to the bottom of this one.
>>
>>Is there any way to get to the "TRUE" filesystem location of the JSP 
>>page I am within? Even if the URI is Mapped through ServletMapping like 
>>below? I've tried getRealPath(...) and this is not accurate on the 
>>Tomcat 4.0.3 version I'm currently using.
>>
>>I need to get
>>
>>/var/tomcat4/webapps/Jaxp/JSPTransformExample.jsp (which really exists!)
>>
>>not
>>
>>/var/tomcat4/webapps/Jaxp/MapExample.jsp (which is virtual and doesn't 
>>exist!)
>>
>>
>>
>>> 
>>>   JSPTestMap
>>>   /Jaxp/JSPTransformExample.jsp
>>> 
>>> 
>>>   JSPTestMap
>>>   /Jaxp/MapExample.jsp
>>> 
>>>  
>>>
>>-Mark Diggory
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>>
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Again! Location of JSP page the Taglib is executing in (really Stuckon this one, PLEASE HELP).

2002-08-28 Thread Mark R. Diggory

I really can't get to the bottom of this one.

Is there any way to get to the "TRUE" filesystem location of the JSP 
page I am within? Even if the URI is Mapped through ServletMapping like 
below? I've tried getRealPath(...) and this is not accurate on the 
Tomcat 4.0.3 version I'm currently using.

I need to get

/var/tomcat4/webapps/Jaxp/JSPTransformExample.jsp (which really exists!)

not

/var/tomcat4/webapps/Jaxp/MapExample.jsp (which is virtual and doesn't 
exist!)

>
>  
>JSPTestMap
>/Jaxp/JSPTransformExample.jsp
>  
>  
>JSPTestMap
>/Jaxp/MapExample.jsp
>  


-Mark Diggory



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Location of JSP page the Taglib is executing in

2002-08-26 Thread Mark R. Diggory

Problems:

I'm trying to get the real file path to a "possibly" remapped jsp page

I.E. in web.xml -->

  
JSPTestMap
/Jaxp/JSPTransformExample.jsp
  
  
JSPTestMap
/Jaxp/MapExample.jsp
  

maps the request "/Jaxp/MapExample.jsp" to "/Jaxp/JSPTransformExample.jsp"

if I run your example on the following uri

http://localhost:8180/Jaxp/MapExample.jsp

I see

/var/tomcat4/webapps/Taglib/Taglib/Jaxp/MapExample.jsp

which is not what I'm looking for, I want to get back

/var/tomcat4/webapps/Taglib/Jaxp/JSPTransformExample.jsp

(This is because "application.getRealPath(...)" does nothing glorious 
but append the the string you feed it onto the real path to the Context. 
It may not neccessarily be a "Real" path.

-Mark

Ryan Lubke wrote:

>Let me try that again
>
>I think you could use the requestURI() method of the
>HttpServletRequest object and pass that to
>ServletContext.getRealPath().
> 
>Example:
>
><% out.println(application.getRealPath(request.getRequestURI())); %>
>
>Output for the following request to the above code: 
>
>Request: http://localhost:8080/tomcat-docs/test.jsp
>
>Result:
>/files/projects/jakarta-tomcat-4.0/build/webapps/tomcat-docs/tomcat-docs/test.jsp
>
>You have to be careful when using this method. If the deployed application 
>is run out of the WAR file (it's not expanded on the filesystem), 
>then getRealPath will return null.
>
>  
>
>>On Mon, 2002-08-26 at 16:17, Mark R. Diggory wrote:
>>
>>
>>>Hi,
>>>
>>>I'm trying to write a Tag that knows the absolute file path of the JSP 
>>>Page it is executing in (Not the request.getServletPath(), which could 
>>>actually just be a servlet mapping) does anyone have any tips on how to 
>>>get this in Tomcat? I was actually looking throught the actuall Catalina 
>>>code base and came across a class org.apache.catalina.Globals which 
>>>suggests that there are references to to things like (jsp-file, 
>>>servlet-path) from the web.xml present in the request sttributes. But I 
>>>fail to see them.
>>>
>>>-Mark
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>>
>>>  
>>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>>
>>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Location of JSP page the Taglib is executing in

2002-08-26 Thread Mark R. Diggory

Hi,

I'm trying to write a Tag that knows the absolute file path of the JSP 
Page it is executing in (Not the request.getServletPath(), which could 
actually just be a servlet mapping) does anyone have any tips on how to 
get this in Tomcat? I was actually looking throught the actuall Catalina 
code base and came across a class org.apache.catalina.Globals which 
suggests that there are references to to things like (jsp-file, 
servlet-path) from the web.xml present in the request sttributes. But I 
fail to see them.

-Mark



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: What sucks about c:import!

2002-08-21 Thread Mark R. Diggory

Shawn Bayern wrote:

>On Wed, 21 Aug 2002, peter lin wrote:
>
>  
>
>>in the interest of discussion. I find it useful to have cookie,
>>user-agent and other advanced capabilities in a web services context.  
>>As web services becomes more common place, supporting those features
>>might become very important.
>>
>>
>
>But is it important to support this from within JSP pages, instead of
>Java-based components?
>  
>
True, but these days, even the simplest of HTTP requests often deal with 
User-Agent to control presentation and cookie headers to preserve State. 
I'm not saying I want a full HttpClient implementation in my taglib, 
just a wee bit more access to the standard "URL/URLConnection" 
properties. Such that I can pass on a cookie I may have.

Again, I'll send this discussion onto the expert group.

-Mark


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: What sucks about c:import!

2002-08-21 Thread Mark R. Diggory

The Jakarta Commons HttpClient has been usefull to me on a limited basis.

All I really use it for is for building "Multipart File Posts". And to 
do that I even had to use a Class someone wrote which is not in the 
HttpClient package right now. The nice thing about the package is that I 
can build a multipart requests off of files on the filesystem instead of 
byte[]'s in memory.

On the other hand, I've recently encountered issues with the responses 
being buffered either in memory or on the filesystem, which kinda sucks 
when all you want is to get an an InputStream on a really big XML file 
and SAX parse it.

So the HTTPClient library is a good package, but I see area's in need of 
improvement in it.

-Mark

Henri Yandell wrote:

>Isn't this the kind of thing that Jakarta Commons HttpClient specialises
>in? In which case a taglib for that would be a pretty nice affair...
>
>[I assume there's not one already..]
>
>Hen
>
>On Wed, 21 Aug 2002, Shawn Bayern wrote:
>
>  
>
>>Indeed - JSTL 1.0 does not support advanced HTTP operations from within
>>JSP pages using  (e.g., basic authentication, free modification
>>of headers), but a future version of JSTL could if there were enough
>>perceived need.  As Peter says, it's a good idea to inform the expert
>>group if you'd like to see this feature; the address is
>>
>>   [EMAIL PROTECTED]
>>
>>--
>>Shawn Bayern
>>"JSTL in Action"   http://www.jstlbook.com
>>
>>On Wed, 21 Aug 2002, peter lin wrote:
>>
>>
>>
>>>I'm assuming you want to get at things like cookies, user-agent and
>>>other http header data.
>>>
>>>you may want to make a request to the expert group, so that it is
>>>included in the next version of JSTL. I believe the current
>>>importsupport class just uses standard url & httpurlconnection classes.
>>>shawn will know more about the current implementation and where it might
>>>go in the future.
>>>
>>>
>>>peter
>>>
>>>
>>>"Mark R. Diggory" wrote:
>>>  
>>>
>>>>Now that I have your attention. We are continually working with managing
>>>>headers in our URL object requests to get resources from different
>>>>locations. Is there really any way I can set the request Header info on
>>>>the URL object being created by c:import? Right now I have my own custom
>>>>implementations to aquire such resources. I'd rather be able to use the
>>>>Standard Taglib.
>>>>
>>>>-Mark Diggory
>>>>Harvard-MIT Data Center
>>>>
>>>>--
>>>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>>>
>>>>
>>>--
>>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>>
>>>  
>>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>>
>>
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: What sucks about c:import!

2002-08-21 Thread Mark R. Diggory

Thank you, I will post my comments there as well.

On another note, I've been playing around with Taglibraries for some 
time now. I'd like to integrate the EL Engine into my libraries, from 
what I understand it is now going to be part of the JSP 2.0 spec as 
well. How might I go about integrating it into my Taglibraries? I've 
seen examples like the following, is this really all I need to do?

import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;



public int doStartTag() throws JspException {
reader = getReaderFromFile((String)eval("file", file, 
String.class));
exposeVariable(reader);
return EVAL_BODY_INCLUDE;
}




//*
// Utility methods
   
/**
 * Evaluate elexprvalue
 */
private Object eval(String attName, String attValue, Class clazz)
throws JspException {
Object obj = ExpressionEvaluatorManager.evaluate(
attName, attValue, clazz, this, pageContext);
if (obj == null) {
throw new NullAttributeException("file", attName);
} else {
return obj;
}
}
   
private void exposeVariable(Reader reader) {
if (id != null) {
pageContext.setAttribute(id, reader);
}
}

thanks,
Mark Diggory



>Indeed - JSTL 1.0 does not support advanced HTTP operations from within
>JSP pages using  (e.g., basic authentication, free modification
>of headers), but a future version of JSTL could if there were enough
>perceived need.  As Peter says, it's a good idea to inform the expert
>group if you'd like to see this feature; the address is
>
>   [EMAIL PROTECTED]
>
> -- Shawn Bayern "JSTL in Action" http://www.jstlbook.com On Wed, 21 
> Aug 2002, peter lin wrote:
>
>>> I'm assuming you want to get at things like cookies, user-agent and
>>> other http header data.
>>> 
>>> you may want to make a request to the expert group, so that it is
>>> included in the next version of JSTL. I believe the current
>>> importsupport class just uses standard url & httpurlconnection classes. 
>>> shawn will know more about the current implementation and where it might
>>> go in the future.
>>> 
>>> 
>>> peter
>>> 
>>> 
>>> "Mark R. Diggory" wrote:
>>
>>
>>>> > 
>>>> > Now that I have your attention. We are continually working with managing
>>>> > headers in our URL object requests to get resources from different
>>>> > locations. Is there really any way I can set the request Header info on
>>>> > the URL object being created by c:import? Right now I have my own custom
>>>> > implementations to aquire such resources. I'd rather be able to use the
>>>> > Standard Taglib.
>>>> > 
>>>> > -Mark Diggory
>>>> > Harvard-MIT Data Center
>>>> > 
>>>> > --
>>>> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>>> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>>  
>>>
>>> 
>>> --
>>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>> 
>>
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




What sucks about c:import!

2002-08-21 Thread Mark R. Diggory

Now that I have your attention. We are continually working with managing 
headers in our URL object requests to get resources from different 
locations. Is there really any way I can set the request Header info on 
the URL object being created by c:import? Right now I have my own custom 
implementations to aquire such resources. I'd rather be able to use the 
Standard Taglib.

-Mark Diggory
Harvard-MIT Data Center


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: c:set and scriptlets

2002-03-11 Thread Mark R. Diggory

I'm sorry, that was on the development list, not the user list

Mark R. Diggory wrote:

> See my last message about multipart stuff. You can capture this 
> functionality in TEI (TagExtraInfo) Support class to your tag. Then in 
> your tag you can set the value of the variable via a special method 
> which you have to define.
>
> 
> -Mark Diggory
>
>
> Shawn Bayern wrote:
>
>> On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:
>>
>>> In my code i have 
>>>
>>> I'd like to be able to access the variable x from within a scriptlet,
>>> something like:
>>>
>>> <%
>>> x = x++;
>>> %>
>>>
>>> and vice versa.
>>>
>>> Is this even possible?  I don't see anything in the docs that refer to
>>> such interchangeability. 8(
>>>
>>
>> JSTL doesn't particularly encourage this usage, but it's perfectly
>> possible using older, scriptlet-oriented mechanisms like 
>> .  Just use a  tag after  to declare 
>> your scripting
>> variable.
>>
>> -- 
>> Shawn Bayern
>> Author, "JSP Standard Tag Library"  http://www.jstlbook.com
>> (coming this spring from Manning Publications)
>>
>>
>> -- 
>> To unsubscribe, e-mail:   
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: 
>> <mailto:[EMAIL PROTECTED]>
>>
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: c:set and scriptlets

2002-03-11 Thread Mark R. Diggory

See my last message about multipart stuff. You can capture this 
functionality in TEI (TagExtraInfo) Support class to your tag. Then in 
your tag you can set the value of the variable via a special method 
 which you have to define.


-Mark Diggory


Shawn Bayern wrote:

>On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:
>
>>In my code i have 
>>
>>I'd like to be able to access the variable x from within a scriptlet,
>>something like:
>>
>><%
>>  x = x++;
>>%>
>>
>>and vice versa.
>>
>>Is this even possible?  I don't see anything in the docs that refer to
>>such interchangeability. 8(
>>
>
>JSTL doesn't particularly encourage this usage, but it's perfectly
>possible using older, scriptlet-oriented mechanisms like .  
>Just use a  tag after  to declare your scripting
>variable.
>
>--
>Shawn Bayern
>Author, "JSP Standard Tag Library"  http://www.jstlbook.com
>(coming this spring from Manning Publications)
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: