File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes This weeks giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "This weeks giveaway" Watch "This weeks giveaway" New topic
Author

This weeks giveaway

Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
This week we are giving away four copies of the book "Professional Java Servlets 2.3
And the best part... The Authors, Simon Brown and Sam Dalton, will be online to answer your questions!
Everyone give them a warm JavaRanch Welcome!!!
Thanks to the people at Wrox Press for the book's!
[ May 21, 2002: Message edited by: Carl Trusiak ]

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Wouter Zelle
Ranch Hand

Joined: Apr 12, 2002
Posts: 30
Hmmm, two people to pester with questions
Welcome to the Javaranch, guys. Let me kick off by asking why I should read your book instead of Core/More Servlets and JavaServer Pages? I'd also like to know if you just give the theory, show short examples or work with an extended sample application?
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
I would like to know if the book would be a good study aid for the scjwd exam. Are all servlet requirements covered ?
Gagan Indus
Ranch Hand

Joined: Feb 28, 2001
Posts: 346
Welcome Simon n Sam !
Have heard rave reviews of the book , Is there any sample chapter avialable for reading?
Also , what exactly have you guys covered in context of 'servlet debugging' , if u can provide little detail.. Thankx


Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="http://www.objectfirst.com/blog" target="_blank" rel="nofollow">My Blog</a>
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
welcome Simon and Sam,
consider the chapter 12, available from Simon Browns website as an absolute must-print.
http://www.simongbrown.com/
just wanted to mention
Axel
Zac Roberts
Ranch Hand

Joined: Jan 29, 2002
Posts: 82
Hey Authors-
I am also curious if this is recommended reading for the SCWCD exam. Right now I am reading "More Servlets and JSP" along with Suns specs...
Thanks
Zac


Zac Roberts<br />SCJP2
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
First my I start by saying Hi!
I will address some of your questions a bit later in the day (as my life seems to be one endless round of meetings right now), but be assured that I will address them
Cheers!
Sam


<a href="http://www.samjdalton.com" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of [http://www.amazon.com/exec/obidos/tg/detail/-/1590592255/qid=1068633302//ref=sr_8_xs_ap_i0_xgl14/104-4904002-9274339?v=glance&s=books&n=507846]Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1861007701/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100561X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
welcome simon & sam
how wud you rate your book yourself.
how different is it from the others available??
malhar
Lee Xu
Ranch Hand

Joined: Aug 24, 2001
Posts: 77
Welcome, Simon and Sam.
Can you let me know the content of your valuable book? Thanks.
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Out of curiosity, does your book use examples from any particular app server (apache tomcat, for example)? I realize that the servlet API isn't really tied to an app server, but you need one to execute a servlet and this usually seems to be where I have the most trouble. I was just wondering if your book focused on any one app server or if it left that topic to books devoted to the topic.
Thanks,
Corey


SCJP Tipline, etc.
Michael Pearson
Ranch Hand

Joined: Mar 11, 2001
Posts: 351
Simon Brown's chapter, #12, is available online and is very well written and useful. Are there any plans for Wrox to make more of the text or the entire text available online?
I, like a lot of people, travel as part of my job and cannot carry every "great" book with me all of the time. It is very nice to have pdfs of some titles on the laptop for periodic reference.
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Hi Authors,
Have heard rave reviews abt the book.Is there any chapter of this book for reading.
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
I've read through the posted chapters and previous books from Wrox (and other publishers) and was wondering what Development environment/tool do you typically use to build applications, considering the examples in the book?
Ren Li
Ranch Hand

Joined: Feb 20, 2002
Posts: 64
Welcome, Simon and Sam.
I am following Simon's suggestion to implement model 2 structure. When I change from JSP controller to Servlet controller, similar to FrontController, Action abstract class and Model class in your Chapter 12, I wonder if JSP is simpler in ensuring thread safe. For instance, in JSP <%@ page isThreadSafe="true" %> <%!-- Default --%>; but in Servlet, I have to write many synchronized{} blocks. Could you please explain which is the better way for thread safe?
Thanks.
Ren
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Was wondering what you take on JSP TagLibs are?
I've read several books and articles on the
topic and used a few from apache.org, but have yet to encounter a "real world" requirement to implement custom tablibs.
Have you encountered something similiar?
Ren Li
Ranch Hand

Joined: Feb 20, 2002
Posts: 64
Good point, David. Currently, there is no JSP Tablib in my JSP controllers, but I am going to add some in the near future. If we combine JSP controllers and Servlet controllers in the same system, it is kind of messy, isn't it? Sam and Simon, Please response!
Ren
Gerry Giese
Ranch Hand

Joined: Aug 02, 2001
Posts: 247
I'm another one in the Servlet controller camp. The framework I wrote/use relies on JSPs for the view, but so far nothing I've done has required using custom taglibs. I also don't have to put up with whiny HTML designers that always ask "How do you do that in Dreamweaver??", so maybe I'm just special.
I have a question: are servlets set for load-on-startup supposed to load at app server startup, or at first-access of the webapp?? The iPlanet app server I'm stuck with at the moment looks like it does first-access. Seems like the app server startup is when it should happen.
I have another question: I haven't read about Servlet Filters yet (I need to win this book so I can!), but would doing a GZip on output streams coming from servlets be best done in the servlets themselves, or in a servlet filter that compresses the output of another servlet. Can a webapp be easily configured so that ALL servlets output to a single filter? If so, can you still insert another filter manually in the middle of the process?
Ok, enough harassment for now..


CJP (Certifiable Java Programmer), AMSE (Anti-Microsoft Software Engineer)
Author of Posts in the Saloon
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Laf... (Gerry)
I can't tell you how many times I've had to deal with the "Dreamwaver" syndrome... ^-^
We do, however, have specific "interface" people who are typically graphical designers versus a "developer/architect".
Often when we leave interfaces to developers what get functionally works, but tends to be very sterile.
To find a person who excells at both is like the Holy Grail (for us).
Our approach has been that the graphical designer creates the interface, navigation, in whatever tool they are comfortable with. Then, in the places where the dynamic content / functional code is placed, they simply have text like "<LATEST NEWS GOES HERE>".
With a simple few lines of code, the developer inserts the call to the controller in the JSP and we're done.
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Another issue we deal with in servlets is when we have to do a site that one of the requirements is to use .htaccess files for authentication.
We can get the prompt just fine and it validates, but the "logout" process has been very elusive.
I've monitored the discussions on the Ranch about this and the solutions are like "well just do this and it works, honest".
That's never been the case for us during our deployments on the various versions of Unix, Linux, and HP-UX.
They are slightly different, eventhough they use .htaccess and the same java code returns various errors on each platform...
Anyonoe have a definitive answer of how to do this in a servlet?
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Wouter Zelle:
Hmmm, two people to pester with questions
Welcome to the Javaranch, guys. Let me kick off by asking why I should read your book instead of Core/More Servlets and JavaServer Pages? I'd also like to know if you just give the theory, show short examples or work with an extended sample application?

OK then, time to start answering some questions
My opinions of why you should read our book as opposed to one of the other servlets titles avaliable on the market focus on the Multi author approach. When you buy our book you get the opinions and real world experience of all of the authors involved. this gives you lots of different points of views about the world of Servlets.
Also the book is loaded full of worked examples, so that you dont just have to wade through pages of theory.
Hope this answers your questions.
Cheers
Sam
[ May 21, 2002: Message edited by: Sam Dalton ]
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Nigel Browne:
I would like to know if the book would be a good study aid for the scjwd exam. Are all servlet requirements covered ?

I think that this book would be an excellent source of reference for the SCWCD exam. All of the requirements are covered, along with much much more.
Sam
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Lee Xu:
Welcome, Simon and Sam.
Can you let me know the content of your valuable book? Thanks.

Hi there
the contents of the book is boradly as follows:
The servlet container and the services it provides
Creating and deploying web applications in Tomcat
Persisting the state of servlets
Filters and Event Listeners
Security and Container Authentication
Debugging servlets
The effects of classloading and synchronization on the behavior of web applications
Optimizing the performance of web applications
Using servlets as agents with web services
Hope this helps
Sam
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Corey McGlone:
Out of curiosity, does your book use examples from any particular app server (apache tomcat, for example)? I realize that the servlet API isn't really tied to an app server, but you need one to execute a servlet and this usually seems to be where I have the most trouble. I was just wondering if your book focused on any one app server or if it left that topic to books devoted to the topic.
Thanks,
Corey

Hi there
The book aims to be independent of app server. However there are instructions regarding deploying the sample code into tomcat, as well as Tomcat setup details.
sam
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by David Yutzy:
I've read through the posted chapters and previous books from Wrox (and other publishers) and was wondering what Development environment/tool do you typically use to build applications, considering the examples in the book?

Hi there David.
with regards to development environements, I personally favour Eclipse from the Eclipse project (www.eclipse.org) However when I wrote my examples for the book it was not in enough of a stable state so I used TextPad (a simple text editor) and javac o nthe command line. Sometimes I still find this the quickest options. However I would recommend taking a look at Eclipse
cheers
Sam
Ian Lockwood
Greenhorn

Joined: Aug 01, 2001
Posts: 22
Hi I'm new to servlets and have been studying them as part of my IT degree I take the exam on thursday 23rd May. The module is all about web programming. I have been making use of another Wrox book for my revision Professional Java Server Programming J2EE edition.
What extra does your book offer if I choose to extend my knowledge of servlets after my exams? Also Servlets and JSP's are closely related what does your book have to say about JSP's?
Thanks
Ian


When eating an Elephant take one bite at a time.<p>Ian...........
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by David Yutzy:
Was wondering what you take on JSP TagLibs are?
I've read several books and articles on the
topic and used a few from apache.org, but have yet to encounter a "real world" requirement to implement custom tablibs.
Have you encountered something similiar?


I should really let simon answer this, and I am sure he will have something to say on this subject (he has just written a book on the subject of taglibs )
I have found taglibs very useful on several real world projects. Examples of the usage are:
1) contolling display of content on a page depending on the users role
2) iterating through collections
3) formatting in a locale sensitive way
these are just a few examples but I suspect Simon will have many more to add.
Cheers
sam
Uday Kiran
Greenhorn

Joined: Jan 22, 2002
Posts: 12
Question on HttpServletRequest Object:
What is the recommended procedure making a deep copy of the request object. I am using the MVC architecture to channel the request to the front controller. I want to make a deep copy of the request object (which would have the request parameters from a form).
Thanks!
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Gerry Giese:
I'm another one in the Servlet controller camp. The framework I wrote/use relies on JSPs for the view, but so far nothing I've done has required using custom taglibs. I also don't have to put up with whiny HTML designers that always ask "How do you do that in Dreamweaver??", so maybe I'm just special.
I have a question: are servlets set for load-on-startup supposed to load at app server startup, or at first-access of the webapp?? The iPlanet app server I'm stuck with at the moment looks like it does first-access. Seems like the app server startup is when it should happen.
I have another question: I haven't read about Servlet Filters yet (I need to win this book so I can!), but would doing a GZip on output streams coming from servlets be best done in the servlets themselves, or in a servlet filter that compresses the output of another servlet. Can a webapp be easily configured so that ALL servlets output to a single filter? If so, can you still insert another filter manually in the middle of the process?
Ok, enough harassment for now..

with regards to Load on startup. I think (and am pretty sure) that this means Load on the startup of the web application. This could well be the first access (i.e. when the servlet context is iniialised)
Sam
Kelly Harris
Greenhorn

Joined: Mar 27, 2002
Posts: 22
This is why I like this site so much, people are willing and able to answer questions without expecting anything in return.
I am not real familiar with servlets yet but I appreciate having people like you around.
Thanks
Kelly Harris
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Ian Lockwood:
Hi I'm new to servlets and have been studying them as part of my IT degree I take the exam on thursday 23rd May. The module is all about web programming. I have been making use of another Wrox book for my revision Professional Java Server Programming J2EE edition.
What extra does your book offer if I choose to extend my knowledge of servlets after my exams? Also Servlets and JSP's are closely related what does your book have to say about JSP's?
Thanks
Ian

Hi there Ian,
Primarily what our book offers over the other book that you mention is coverage of the servlets 2.3 specification. also this book goes alot deeper into servlets (as that is its one and only focus) that the other book, so more advanced issues are covered.
The book does not really go into JSPs too far, you should consider the other Wrox publication Professional JSP
Cheers
sam
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Originally posted by Sam Dalton:


I should really let simon answer this, and I am sure he will have something to say on this subject (he has just written a book on the subject of taglibs )
I have found taglibs very useful on several real world projects. Examples of the usage are:
1) contolling display of content on a page depending on the users role
2) iterating through collections
3) formatting in a locale sensitive way
these are just a few examples but I suspect Simon will have many more to add.
Cheers
sam

I've seen these small examples, but what I was looking for was something like "Yeah, we created this accounting site where the CPA's could modify the content using specific accounting tags we created. They didn't need to know HTML, just the custom tag syntax!"
Or, "we recently created a site that allowed our content manager to add web content without needing to know HTML, just a few custom tags!"
From all the hype out there on taglibs, everyone seems to be using them to simplify common java and/or display tasks but nothing with more "meat" like business logic simplification or bean replacement (e.g. custom tags instead of beans in JSP).
Hoping Simon can elaborate a bit more...8)
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Uday Kiran:
Question on HttpServletRequest Object:
What is the recommended procedure making a deep copy of the request object. I am using the MVC architecture to channel the request to the front controller. I want to make a deep copy of the request object (which would have the request parameters from a form).
Thanks!

I wonder why you would want to do this? I can't think of a particularly compelling reason to copy rather than pass by reference...
Perhaps if you provide some more information...?
sam
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Kelly Harris:
This is why I like this site so much, people are willing and able to answer questions without expecting anything in return.
I am not real familiar with servlets yet but I appreciate having people like you around.
Thanks
Kelly Harris

Aww thanks, it is nice to be appreciated
That is the same reason that I was drawn to javaranch in the first place, and the same reason that I am happy to come here and help where I can!
I would definitely recommend the book if you would like to know more about servlets
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by David Yutzy:

I've seen these small examples, but what I was looking for was something like "Yeah, we created this accounting site where the CPA's could modify the content using specific accounting tags we created. They didn't need to know HTML, just the custom tag syntax!"
Or, "we recently created a site that allowed our content manager to add web content without needing to know HTML, just a few custom tags!"
From all the hype out there on taglibs, everyone seems to be using them to simplify common java and/or display tasks but nothing with more "meat" like business logic simplification or bean replacement (e.g. custom tags instead of beans in JSP).
Hoping Simon can elaborate a bit more...8)

david,
In that case I will leave it to Simon
sam
Uday Kiran
Greenhorn

Joined: Jan 22, 2002
Posts: 12
Originally posted by Sam Dalton:

I wonder why you would want to do this? I can't think of a particularly compelling reason to copy rather than pass by reference...
Perhaps if you provide some more information...?
sam

PROBLEM DESCRIPTION:
====================
I have form "A" which the user fills up with a bunch of data and half way through realises that the location data from the drop down in form "A" does not have his location. Hence he needs to add the location before proceeding. We provide a button on form "A" which the user clicks ( "Add Location") which should take the user to a different form ...form "B", let him add to location and automatically take the user back to form "A".
Summary: When user clicks a btn on a form, we want to store the original request and let him do a different action and re-display the origianal page.
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Originally posted by Uday Kiran:

PROBLEM DESCRIPTION:
====================
I have form "A" which the user fills up with a bunch of data and half way through realises that the location data from the drop down in form "A" does not have his location. Hence he needs to add the location before proceeding. We provide a button on form "A" which the user clicks ( "Add Location") which should take the user to a different form ...form "B", let him add to location and automatically take the user back to form "A".
Summary: When user clicks a btn on a form, we want to store the original request and let him do a different action and re-display the origianal page.

I think you should probaly look at another way of doing this. For example, take the form variables from the first form, populate a javabean with the values, put this in the session and use it to poulate the form when you return to it....
I think that copying and restoring sessions could cause some pretty big problems...
sam
Uday Kiran
Greenhorn

Joined: Jan 22, 2002
Posts: 12
Originally posted by Sam Dalton:

I think you should probaly look at another way of doing this. For example, take the form variables from the first form, populate a javabean with the values, put this in the session and use it to poulate the form when you return to it....
I think that copying and restoring sessions could cause some pretty big problems...
sam

Thanks for your prompt reply. I really appreciate your help. I have a built a framework and at this point to time, I am not a able to take the path you suggested. But, do you think I can use the "HttpServletRequestWrapper" class.
The sun j2ee api lists this class as part of j2ee 1.3, but I still can't find this class...
thanks!
chris coleman
Ranch Hand

Joined: Mar 06, 2002
Posts: 42
congrautlations to sam and simon on their book.
our questions are:
what does your book cover as far as some of the api improvements available in servlet 2.3 versus 2.2 ?
what are your plans with respect to updates to your text in light of upcoming releases of servlet api 2.4 (?) and upwards..?


Sun Certified Java Programmer for the Java2(tm) Platform<br />IBM Certified Solution Developer, WebSphere 3.5
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Hello everybody...
Been having a few difficulties getting on the Internet today. I've no access at work at the moment and my BT DSL connection is really messing me around so I'm not sure how long I'll be on-line this evening.
Looks like Sam has been doing a good job answering all of your questions though!
Cheers
Simon
Naveen Sydney
Ranch Hand

Joined: Jan 21, 2002
Posts: 30
hi sam and simon nice to have u guys here answering our questions....
Today people talk about all the mvc approach and that servelts should be used as a controller and the presentation logic implimented in jsp & taglibs! whats ur take on it?
regards
syd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: This weeks giveaway
 
Similar Threads
Urgent......interview questions in jsp,servlets,javabeans?
Mouse for arthritis sufferers
Problem while booting Win XP
SCJP
Placement in India- How to handle break in career