Faisal Ahmad

Ranch Hand
+ Follow
since Aug 31, 2006
Faisal likes ...
Firefox Browser Redhat Java
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Faisal Ahmad


When can we expect K&B book on OCP Java 17 to be available?
Are you new to servlets & jsps? If yes, go and grab Murach's Servlet & JSP book. It explains you how to build professional web application using servlets & jsps. They also have code available online.

9 years ago
Though Spring and Struts are widely used, everything depends on your requirements.
9 years ago
I believe, it lives until response is committed. I think, once the response is committed it can't be accessed.

Have I got that right?

Ulf Dittmer wrote:A response is generated once it's been determined how a request should be handled.

You mean - ServletResponse reference that is passed to a servlet doesn't refer to an existing object?

Ulf Dittmer wrote:So from that I find it more natural to attach attributes to requests, because the request will exist even when the response does not yet.

On a more practical level, I think it would be confusing to have attributes for both. By choosing one, it's clear where to look for attributes.

Consider the below flow:

Container passes client's request as an input to Servlet -> Servlet processes the input and adds its output/response to the ServletResponse object and then passes on these objects to next in action (view for e.g.) -> View checks the ServletResponse and performs some action based on the what it found.

It's Servlet's response. So, isn't it more intuitive/logical to find it in a 'ServletResponse' object?

Maneesh Godbole wrote:'Have' is correct English. Why do you want to change it to 'has'

I have some confusion regarding when to use 'doesn't have' and 'doesn't has'. I searched for some guidance on the web but I'm not fully convinced with the info that I found so far.
Instead of adding attribute to the request object that's being passed to any 'view' from a servlet for e.g., it is better to add it to the response object - that sounds intuitive. It's like - servlet does something with the request (input) and passes on its results (output) through response object to the next item in action.

Looks weird? Please share your thoughts.

Under what circumstances do you expect to see it?

Good question!
9 years ago
Thanks a lot! Great book to have.
9 years ago

Mohamed Iqzas wrote:Its getting more difficult for me to learn a framework. Is it possible to develop huge enterprise applications without any particular framework?

Just with JSP, Servlets and Javascript/Ajax stuffs?

What is the framework that you are trying to learn and facing difficulties? Maybe we can help.
9 years ago
Hi Joel,

I bought your 2nd edition long time back and it helped me a lot! Great book. Thanks a lot! I like the presentation in your books. Absolutely fantastic. That motivated me to buy another one as well - Oracle Pl/SQL book. Also, because I read your book, I've been using NetBeans as my IDE.

Well, I just saw the contents of 3rd edition book - you've included JPA. Which implementation of JPA you discussed? Hibernate? Could you please discuss what motivated you to a particular implementation that was discussed in your book. In your 2nd edition book, you've shown us how to implement authentication of a webapp using Tomcat JDBC realm. That was helpful. But, it would have been better to see an example using DB for authentication and authorization. Are there any such examples in your new book? I wish to see some basic introduction of design patterns.

Well, your books are very helpful and great. Thanks again!

PS: Observed an error in TOC of 3rd edition: Chapter 20: How to work with fliters. It should be filters.
9 years ago
Thanks for your reply!

I read few more pages further and found my mistake:

I didn't specify class.

HFSJSP, page 350 says that <jsp:useBean> can also create a bean.

I tried a simple program and I'm seeing below exception:

I further looked into the generated JSP file and it is different from what has been shown in the book:

Can someone please explain why it is not creating a new Person bean and instead throwing an exception?

I'm using Struts 1.3 for my application. I found that Struts is not 'selecting' a value if the value type is Integer in html:select and html: option. It's selecting if the type is String. Why? See the below code:

Where roleId is an Integer and roleName is String.

The web page displays:

As you can see, there is no 'selected' property for Integer values. Can someone explain why? What is the solution for this?

Many thanks in adv.!
9 years ago