★ wanayoo — archive 1999 http://developer.java.sun.com/developer/community/chat/JavaLive/1999/jl0824.htmlNouvelle recherche | Portail wanayoo
Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Chat

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
JavaLive Transcripts Index

JavaTM Live
JavaServer PagesTM
August 24, 1999

Speakers: Eduardo Pelegri-Llopart (pelegri) and Larry Cable (LarryC)

Moderator: Edward Ort (MDR-edort)

This is a moderated forum.

MDR-edort: Welcome to our JavaTM Live session on JavaServer pages. Our guests today are Eduardo Pelegri-Llopart and Larry Cable, the authors of the JSP spec. They'll answer your questions about the spec and the technology in general. Our session will begin at 11:00 a.m. (in about 10 minutes).

MDR-edort: We're a little slow off the mark today. Our guests haven't arrived yet. But they should be here soon. Please bear with me for a few minutes.

prenzl: Is JavaServer Pages ready to use? How does it coordinate/differ from the Apache/Open Source efforts?

pelegri: Hi everybody, sorry for being late. JSP 1.0 is out and all-but final. There is a new RI out and a companion specification update. Very few things have changed since the previous update. The "all-but final" part is because we are awaiting a final version of the license.

minotauros: Is it possible to pass properties in a bean constructor instantiated in a JSP?

LarryC: Is it possible to pass properties in a Bean Constructor? Well, I'm not sure what you mean here by properties? By definition a Bean's constructor is a public no-args constructor so no arguments should be passed, but they can be set later using property setters. Does that answer your question, minotauros?

val2: When you do a

jsp:useBean id="myBean" 
        class="com.someplace.myClass"

Is there a clean way for myBean to identify its own ID? I would like to do this to facilitate using beans from other beans without using Java code directly (to keep the HTML totally insulated from the Java).

pelegri: A follow-up to my previous answer, on the Apache/Open Source efforts: The specification is being developed using the Java Community Process, the reference implementation will be delivered through the Apache Jakarta group. License details will be those of the Apache license. Things are moving along pretty well, but there are still some details of the legal arrangement between Sun and ASF (the Apache Software Foundation) that have not been finalized yet.

LarryC: Val2, when you say a bean ID, what do you mean?

Marc Hedlund: What happened to the planned Second Public Draft of the JSP 1.1 specification? It looks like you jumped from PD1 to PR1 directly.

Marc Hedlund: I'm still concerned about how you would include a taglib in a Web application (.war) when you have to use a full URI to include the taglib on a page. Can you walk me through it? Let's say I have a .war file (helloWorld.war) that contains:

 /hello.jsp 
/TagLibClass.class

On hello.jsp, I want to use a taglib directive to include the .war taglib. How do I do that?
taglib uri="???"
	prefix="helloTag"

It still seems to me that this would be a lot more clear if a taglib directive could contain a "file" attribute, so it would be consistent with the include directive and it would be clear how to use taglibs in
.wars.

Can this be included in the spec? Thanks!

pelegri: It could be described as us being just too optimistic about timing. We didn't have the time to get the PD2 out so instead we focused on interacting within the expert group. We had hard deadlines related to Java2 Enterprise Edition so we could not just delay PD2.

LarryC: Marc, the taglib uri can be a file: protocol, and the intent would be that for a taglib in a WAR that the URI attrtibute would be a relative URI within the WAR. this is something we are still working on for 1.1. This sort of issue is exactly what we want to hear you post on jsp-spec-comments@eng.sun.com

Abraham Kang: What is the best way to integrate JSPs with EJBs? For example we are using a JavaBean as wrapper to the EJB client. The JavaBean is persisted as a instance variable in the Servlet using the <%! %> tags (The JavaBean holds the context to the ejb objects) Whenever we return data (by-value) to the JSP, we use a Vector which stores the returned ObjectType objects. We are thinking of using a dataset type object to generalize the results passed back to the JSP versus ObjectTypes stored in a Vector. What are the advantages/disadvantages to using this?

Kevin: I've just finished reading the latest JSP 1.1 spec and I'm very interested in the new taglib directive. Any idea when a JSP 1.1 implementation that supports tag libs will be available?

LarryC: Kevin, the JSP 1.1 RI with taglib support should be available "real soon now". Sorry I can't say more than that.

val2: Basically the id="whatever" part of the declaration. I want to store this somewhere else so that other beans can perform a look up later to talk to that "whatever" bean. like, say,

jsp:setProperty name="otherbean" value="whatever"/

pelegri: Hi, Abraham: re: integrating JSPs with EJBs... You are in the correct ball-park: use a server side object that is providing the mediation to the EJB. What some people are doing is encapsulating the EJB access into an "accessor" bean; either to be used through a usebean directive, or as a custom tag. I personally think the second approach will be very useful: a tag library will provide an encapsulation of the business-logic of an EJB Whether to use a Vector or some other abstraction depends on the details of your appliication. Sorry, cannot help much there.

JeffS:.. would like to hear about any interesting tools for composing JSPs.... and any interesting tutorials and demos.

LarryC: If you read the 1.0 spec carefully it states that the "id" parameter is "special", in particular:
1) declares a scripting language variable with the id name
2) it creates an association in the PageContext with the name/bean (in the appropriate scope.
So you can use the PageContext from another bean to rendezvous. Does that help?

minotauros: Actually what I would like to do is to use a constructor with parameters. Is that possible?

LarryC: Re: minotauros. no, not really I'm afraid. it breaks the model.

lturcotte: How do you get session management to work when your web page contains multiple frames (i.e. each of the frames in the same page to refer to the same session)?

pelegri: Hi Jeff: re: tools, etc. You are correct in subdividing "tool support" into authoring tool and development/debugging support. There are good news on both fronts although some of that is not yet public. There are at least two companies that have authoring tools out there now: NetObjects and Elemental Software (Drumbeat); several others not announced. A number of companies will support development/debugging but I to not remember right now which ones are announced. Our web pages java.sun.com/products/jsp should have a list of this. Our new marketing manager (Michaela Gubbels) will be updating the pages in the next few weeks.

andrei1: It seems that POST doesn't work (JDK 1.2-1.2.2, Win95, IE/Netscape 4.0). I noticed that most JSP examples that come with JSWDK-1.0 use the GET method. Two of the examples that were intended to use POST (carts.html and check.html) use the default GET method because they have a bug in the html code
(the files contain

form type=POST

instead of
form METHOD=POST
.
They use the default GET method because
type
isn't a correct attribute). Are you aware of that?

LarryC: Re: session mgmt in multi-frame pages: This isn't really a JSP issue, it is more of a general HTTP/HTML issue, however the solution wouLd be based around properly encoding the Session reference as a cookie in the response or re-writing the URL's. Hope that helps.

TomH: Would either one of you explain a little more about the

jsp:setProperty name="name>"
	property="*" 
; option versus
% name.processRequest(request); %

I understand the concept, but I am a bit confused on the difference when a request is made, exactly what the
flow
is.

pelegri: That was a problem with the previous version of the RI. Is this problem with the latest RI?

minotauros: What about support for encodings different than of ISO-8859-1? Specifically there is no support at all for GREEK language (ISO-8859-7) in JSP1.0

pelegri: Hi Minotaur. I think this problem got fixed in the latest RI.

Marc Hedlund: Can you tell us how the Jakarta project is proceeding?

LarryC: TomH, regarding the property setting Vs processRequest(). In 0.9x versions of the spec there was this interface that allowed a JSP to redirect the incoming request to a JavaBean. this is a very coarse-grain mechanism and also results in creating 'special' JSPBeans. This was something that the expert group did not want to do especially since the taglib facility would be coming along in 1.1 (take a look at that it is really cool). The model in 1.0 is that you take a simple bean, and use a combination of scripting and setproperties to set and invoke methods on a 'std' Bean (as opposed to a special purpose interface). In 1.1 you can create a declarative only scheme using a taglib and a Tag class. Then you have more control.

Marc Hedlund: Larry, thanks for the answer (re: taglibs and URIs). I will send a follow-up to the spec comment address; is it still possible to make clarifications in the spec while it is in public release?
(Eduardo, understood about J2EE deadlines. Thanks for the response.)

pelegri: Hi Marc: re: How is the jakarta project going. Most of the JSP implementation team is actually at the O'Reilly open source conference down at Monterey. We demoed the implementation that is going to go into the Jakarta repository [BTW, for those of you who do not know, Jakarta is the name for an Apache working group that will provide a JSP and Servlet implementation -- I refered to this in a previous reply] At the BOF on Sunday evening, IBM reported that their people would be contributing to the Jakarta source space. The Apache people also pointed out that JServ will be folded in. We are pretty much just awaiting for some legal issues to resolved. As indicated before, this is the first ASF legal agreement, so this is not surprising.

LarryC: Marc: We can make minor changes in the spec during PR as a result of experiences in implementing the specification (that is what this part of the process is specifically designed to allow) So, you can expect to see some changes (especially in the taglib model) in the next release of the spec.

Zoey: Howdy, I'm still using the 0.92 spec. Will most vendors still support the .92 spec or do I need to change my JSPs to 1.0 spec?

LarryC: Zoey, sadly there isnt a 0.9x 'spec', they were only drafts. Now some vendors (who shall remain nameless) have choosen to release a product based on that. for us these drafts are obsolete. and these vendors are now committed to moving to 1.x ASAP as their schedules allow. You need to move to 1.0 or 1.1. the 0.9x drafts ARE NOT compatible with 1.x. Sorry!. this is a side-effect of internet time on s/w development and evolution!

Marc Hedlund: There have been a few comments on JSP-INTEREST about getting JSP pages to recompile when the includes on the page change. Can you give us an update on this issue? We wind up having to recompile every page on the site, which causes a slow-down as the pages rebuild. Thanks.

Mike Azzi: Question about (.jsa) files. In 1.0 PDR1 you mentioned that they will be evaluated in future releases. Is there a time frame as to when we will start seeing them? Can you shed some light on how they will look like if any? Will they have JSP like syntax? What about any corresponding events?

pelegri: Hi Marc: re: getting JSP pages to recompile... You can use an include action, rather than an include directive. That way there is no recompilation involved. The include action can refer to a JSP page as well as a plain static object. The only issue is that the output will be flushed out, which means that features that require the HTTP header (like cookies or redirects) will not work; this limitation is due to the underlying Servelt API and will be removed in a later release. Hope this helps.

LarryC: Mike Azzi: re: .jsa files. JSP 1.1 does not include .jsa support. We thought that taglib was more important and we were time constrained by J2EE schedules. We already have an internal (tag level) level proposal (based around JavaBeansTM events) that we have shared with the experts. We are already planning JSP 1.(n>2) and application/event support *may* make it in. What do you think?

EthanH: Will the full JSP engine code be made available to licensees (or is it already available)?

pelegri: Hi Ethan: re: will the JSP engine code be made available to licensees. As soon as the legal issues are resolved, we will deliver it to the Jakarta side and you will be able to get it from there. There is no special automatic arrangement with licensees.

TomH: So it sounds like you really don't recommend using the processRequest(request); method, and basically let the bean do the work where possible via the setProperties if I understand correctly? I'm using the 1.0 spec & reference implementation. When is it expected to have a 'production' version available.

LarryC: Tom H: No we do not recommend using

processRequest() 

that is a 0.9x feature that is not supported in JSP 1.x. In 1.0 use beans, setproperty and script. In 1.1 make it a taglib.

val2: When you do a

jsp:useBean id="myBean"
 	class="com.someplace.myClass"/
,
is there any way for the myBean bean to know that its ID is
myBean
?

minotauros: Why doesn't

isNew() method (of HttpSession)
works (that is return true) the first time a jsp is loaded? It starts working only after the first session of the user expired.

LarryC: minotaur: It should. It must be a bug in the JWSDK.

LarryC: minotaur: Can you file that as a bug on the JDC and/or send email to the JWSDK feedback list?

EthanH: This is really a comment and not a question. You know you're driving us crazy by saying 'make it a taglib' without having any implementations that have taglibs in them!

pelegri: Hi Val: re: having a Bean invoked via a useBean 'know' about its 'ID'? Not when using the useBean 'protocol', but yes if you make the Bean a Tag. Then you can get at all this information via a TagData...

val2: So, any hope for beans taking other beans as parameters anytime soon?

LarryC: EthanH: SORRY!!! We would have put taglib support in 1.0 but we ran out of time. Eduardo and I took over JSP in Feb. We have moved pretty fast since then! I strongly recommend you head in the taglib direction, once/when tools explode onto the market taglibs will be the way to go. Think of it as components for dynamic page composition. There will be some real opportunities there for people to exploit!

pelegri: Hi val: re: Any hope for beans taking other beans as parameters anytime soon? Not sure you will like the answer but . . . Make them a Tag handler. The key thing here is that a tag library is a richer protocol and you can do a lot with it.

MDR-edort: There have been a lot of excellent questions, but the number of questions in the queue is dwindling. If you have something to ask Eduardo or Larry, please ask it now.

LarryC: val2: You can using beans properties, but not via the constructor. It's too expensive since it would require introspection at request time to find the right constructor

Marc Hedlund: Thanks for all the answers, and congrats on the public release of 1.1.

luis: Could you post a simple example where using a taglib would be a cool idea ? I have never used this before.

pelegri: Sure thing. Remember to send feedback on the spec to jsp-spec-comments@eng.sun.com, and feedback on the spec to jswdk-feedback@sun.com

pelegri: The better the feedback, the better the final spec and implementation.

val2: This isn't really a question, but I'd like to say that JSP is so compelling a solution our whole comapny is moving towards it as fast as possible.

pelegri: Hi Val: re: moving to JSP as fast as possible... That is great to hear. We think JSP are very compelling, and we think that there is much more to come. A large number of companies thing so too, expect more good news in the months to come. Specially as other related technologies, like J2EE, go final.

EthanH: Do you think HTML authoring tools with proprietary tag extensions will drop them for JSP?

LarryC: luis: (there are some exmaples on the website. Suppose I want to create a page containing:

<com.database.vendor:createconnection id="conn1"
db="..." ///
<com.database.vendor:sqlquery connection="conn1" resultset="rs1" .>
// put SQL in her
</com.database.vendor:sqlquery>//
<com.database.vendor:foreach item="rs1".>
<li><com.database.vendorprettyprintitem /></li>
</com.database.vendor:foreach>

The taglib facility would allow me to extend the JSP tag language with thesnew tags in a portable fashion. and create the underlying Java code to implementhe database connection, sql query, and subsequent pretty printing of thresults. This allows page designers and programmers to be separated. Does that help?

JackH: Is the transcript of this session going to be available?

MDR-edort: Yes, we archive all JavaLive sessions on the Java Developer ConnectionSM site.

val2: Do you know of anyone planning javascript support in JSP?

LarryC: val2: a number of vendors (you can guess who) are planning it. JSP is designed to support scripting languages other than java. javascript seems like a good candidate!

MDR-edort: Our session is slated to end at 12:00 noon PDT, but because we started a bit late, we'll go to 12:10.

pelegri: Hi Ethan; quite prolific an author re: HTML authoring tools with proprietary tag extensions will drop them for JSP? I personally think that JSP 1.1 is already very compelling and that Jakarta gives a very good story on the implementation front. We, of course, cannot speak for individual companies, but we have had very good reaction from the industry as a whole. You may want to check our endorsement list; it is off our web page. It is not up-to-date, for example Allaire is (was?) not listed because the endorsement came just a bit too late for JavaOne.

luis: I would also be interested in your thoughts on EJB integration (of course). A simple diagram on this would be quite helpful!

Joey: Are there any plans for enhancing the specification to include a standard mechanism for distributed session store?

LarryC: luis: regarding EJB integration. In 1.0 I would use a simple Javabean proxy to encapsulate EJB creation etc. Then use usebean/setproperty/and scripting. In 1.1 'you can use a taglib'..

Petr Jiricka: In the 'Futures' section of the JSP 1.1 specification, you are talking about Application event handlers. Can you specify more closely how you envisage this ?

LarryC: Re: events. Before we can include 'application' or 'session' level events in JSP we need to implement this in the Servlet layer. Our basic thinking is that event support would be based around the existing JavaBeans event model (listeners, event objects, event registration methods) Once we have that in Servlet (.next I'm afraid) then it is relatively simple to support it at the tag level in JSP.

lturcotte: The application scope on a usebean seems to be a server scope. That is, when I do a usebean on classx, I get the same instance until the server is rebooted? Hence if I do JSP hosting I can never let my clients use the application session type on a usebean.

pelegri: Hi Joey: re: plans for enhancing the spec to have distributed session store? Have you checked on the Servlet 2.2 spec? There are a few things in there related to this. Also, at some point you may want to consider pushing some functionality into the EJB layer. As part of the J2EE documentation there is an Application Programming Model that should provide some information on how to organize applications. Hope this helps.

luis: What are your thoughts on JSP generation as opposed to hand crafting ? I came across this kind of approach (I don't remember where) in which xml was being used to describe the data, the look, and also the behavior and the jsp page was being generated.

LarryC: lturrcott: yes you are right application scope beans suffer from a limitation in the Servlet spec; where it does not define how an 'application' terminates. Until the Servlet level problem is fixed. we will continue to be broken. Note you *can* 'delete' a previous usebean by (re)setting it's value in the appropriate scope of the PageContext. since usebean looks for the name association there to establish if it needs to create or assign.

Petr Jiricka: In the 'Futures' section of the JSP 1.1 specification, you are talking about Application event handlers. Can you specify more closely how you envisage this ?

LarryC: Re: events. Before we can include 'application' or 'session' level events in JSP we need to implement this in the Servlet layer. Our basic thinking is that event support would be based around the existing JavaBeans event model (listeners, event objects, event registration methods) Once we have that in Servlet (.next I'm afraid) then it is relatively simple to support it at the tag level in JSP.

lturcotte: What is the difference between TAGLIB and TAGEXTENSION ?

LarryC: lturrcott: there is no difference, a taglib is an implementation of a specific set of tag extensions which is the generic mechanism.

Mike Azzi: I am not sure if this question was asked before, but with XML schemas coming into play very soon, how do you think this will affect JSP in general. For instance, will I be able to pass objects as attribute value in setProperty? Etc.

LarryC: Mike Azz: re: XML & JSP. There is a a lot of synergy between XML and JSP, and that is something we are committed to increasing over time. With regard to schemas, they will impact the taglib descriptors capabilities for tools integration (JSP 1.(n>1)). We are also looking into using XSLT from JSP's as filtering; pre, in, post request, but we need basic XML support in the platform first (something I am working on) You can already pass objects as attribute values already. using runtime scriptlet expressions.

lturcotte: You guys keep refering to taglibs and you are quite enthusiastic about them. If I understand well it would seem that they solve many problems.... right??

LarryC: lturcott: Re taglibs! YES YES YES. We are very enthusiastic about taglibs. We really believe that JSP1.1 and JSP 1.(n>1) with taglib support will provide a great story for page designers, page composition tools, and component authors. Using taglibs you can build very powerful, but simple to use page composition tools that non-programmers can use, and the programmers can concentrate on creating powerful reusable web components using taglibs. next year will be the year of the taglib. with servers and tools providing support and JSP 1.(n>1) completing the tools integration story with schema- like power in the TLD, and customizer support (maybe using XML/DOM) ala JavaBeans. ARE YOU EXCITED YET??? CALL YOUR VENDORS, DEMAND JSP 1.1 and taglib support NOW!

pelegri: Hi Luis: re: XML being used to describe data, look, and behavior Structured data is very important. I personally think that this will be most important next year, but in some applications it is important right now. There are several ways in which XML and JSP interact right now. For example, you can have a JSP invoke computation that will read some strctured data (organized as XML) and process that. For example, one could write some custom tags that did something like this using, say, Project X (see java.sun.com/xml). One can also use some transformation on the XML content before sending it down (be it as XML or as HTML), maybe using something like XSLT. Finally, one may want to use XML to describe the JSP itself. I know of several projects that are doing things in these space. For example, Resin lets you use XSLT to author the JSP.

And Cocoon is a more complete complex story. In general there are some interactions between all these things. For example there is the issue of performace, if you are applying XSLT you need a DOM constructred, which takes time. Then you have to linearize the DOM, etc. In general (and in brief, sorry it took this long), we are looking at this intersection of technologies very carefully, but we want to do the right thing. We have a number of directions we are actively exploring and some of our partners have a lot of experience in the area. We expect to address this area well in a future specification. Hope this helps.

TomH: What kind of support can I get from Sun/JavaSoft regarding JSP development? That is, when I have a problem that needs immediate attention, where can I go? I'm probably developing the most advanced JSP app. available.

EthanH: We are definitely excited about the JSP 1.1 spec. Thanks a lot. We'll be waiting for the RI with bells on.

LarryC: EthanH: We are too. JSP 1.1 (tag ext) will be awesome. We are waiting for the RI and products, too. Get tablibs into your business plan now!

pelegri: Hi Tom: re: support There is the Java Platform, and there is Sun. One at a time. The role of the Java Platform group is to advance the platform. The goal of Sun is to make money and to support its customers. At the platform group we will answer questions about the spec (and we encourage feedback), and about the reference implementation. We also work with the vendors. Our goal (in the Java Platform) is to make the platform succesful for all vendors. There is more to this but I do not have the time right now. Sun will provide you support on tools and engines. The Alliance has ambitious plans for supporting JSP (and J2EE) in their products. You should contact a representative of that group.

Michael: The taglib mechanism seems to be very similar to CFML's custom tag solution. Would there be any future support for converting existing CFML pages into JSP ones? If there is going to be a standardized taglib extension set, would it be based on CFML standard tags? I am thinking specifically about CFQUERY and CFLOOP which allow for database SELECTs and iteration of result sets respectively.

pelegri: Hi Michael: Allaire is a key participant in the JSP effort; we cannot talk for them, but you should contact them directly. Note that Allaire acquired LiveSoftware.

LarryC: LASTLY: A CALL TO ARMS: Please send your 1.1 spec comments *and* 1.next requests to jsp-spec-comments@eng.sun.com, this is your chance to effect the technology you work with. we read *all* the feedback and respond to all that we can. Check out our website http://www.java.sun.com/products/jsp for updates and if you find JWSDK problems send them to jwsdk-feedback@sun.com finally, make sure your platform and tools vendors know you want 1st class JSP support! Thanks for using JSP!!! Please keep doing so, we'll keep working on it!

MDR-edort: Well we're coming to a close of a very good session. Thanks for your participation. Signing off.

MDR-edort: Last moderator (me) signing off. The forum is now unmoderated

Forum closed at Tue Aug 24 17:04:57 1999

Max number of users at any time: 43

* As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.


Reader Feedback

Tell us what you think of this transcript.

Very worth reading Worth reading Not worth reading

If you have other comments or ideas for future articles, please type them here:


[ This page was updated: 12-Jan-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.