• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

This weeks giveaway

 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know if the book would be a good study aid for the scjwd exam. Are all servlet requirements covered ?
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
welcome simon & sam
how wud you rate your book yourself.
how different is it from the others available??
malhar
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome, Simon and Sam.
Can you let me know the content of your valuable book? Thanks.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Authors,
Have heard rave reviews abt the book.Is there any chapter of this book for reading.
 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
David Yutzy
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sam Dalton
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..?
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Shiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic