Clifton Eaton

Greenhorn
+ Follow
since Mar 26, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Clifton Eaton

I didn't think the SCWCD exam was as difficult. There is alot of memorization, but I didn't think it was as "tricksy" as the SCJP. I used all of the alloted time for the SCJP, but I finished the SCWCD in about an hour.
18 years ago
Finally got around to taking the SCWCD this morning and passed with 71% I studied the HFSJ off and on since August and then read through most of mikalai's notes. And of course hung out in the SCWCD forum for a while.
18 years ago


OUTPUT
AT SERVER:
SRVE0026E: [Servlet Error]-[/view1.jsp]: javax.servlet.jsp.el.ELException: Unable to find a value for "empID" in object of class "sri.wcd.Person"
using operator "."

AT BROWSER:

ERROR 500.



The exception that is being thrown at the server, is ELException which is not a runtime exception, take a look at the javadoc for ELException and you will see it inherits from Exception, not RuntimeException.
According to JSP 2.0 spec on page 1-69 if the parameter following the dot operator is not a readable property of the bean, it causes an error.

After testing, calling a property that does not exist on the bean causes an ELException which is a checked exception, NOT a runtime exception, hence the correction.

Originally posted by Atul Sawant:
It is adviced to override init() method but if you are overriding init(ServletConfig) then we need to call super.init(ServletConfig). Why?



the important reason to call super.init(ServletConfig) is that it sets the ServletConfig object in the servlet. If you overide init(ServletConfig)without calling super.init(SC) You would not be setting the ServletConfig object.
I do believe it's answer D and E. I think MANIFEST-INF is being confused with META-INF.
Can you supply more details about how you tested?

1. Are these two separate servlets that you call in the order you specified? 2. what is the timeout for the session set to?
3. do you ever wait to see if sessionDestroyed() is called?
body content of jsp is not allowed in a SimpleTagSupport class the reason is that SimpleTagSupport cannot have scripting in the body. body content type of JSP allows for scripting. You can only have:

1. empty
2. tagdependent
3. scriptless
[ April 02, 2007: Message edited by: Clifton Eaton ]
I ran this last night, and the output was "Hello How are you". seems like number 2 is correct. Where did this question come from?
I think the problem is this line:



try specifying a different name. for example in your jsp:useBean tag, use an id of "sessionPerson" and then make the name in your jsp:getProperty tag match that.

I think what is happening is this getProperty tag is looking in the request scope first for an object named "person" and is finding the one you added in the servlet. the getProperty tag then stops instead of looking for the "person" bean you defined with jsp:useBean in the session scope. The bottom line is that jsp:getProperty does not NEED the jsp:useBean because the named reference exists already and will be available in the fully compiled servlet.
Here's a way to accomplish what you want, but you need javascript for it. You basically have to cause a new window to open with a url to a servlet that will send the file with the correct headers for an "attachment" download.

jsp:
------------------------------------


Servlet:
--------------------------------


web.xml
----------------------------
Interesting. I got that information from Sun's J2EE tutorial. I just checked the jsp spec and it does seem to be required.
Tomcat 4.x does not support jsp 2.0 or servlet 2.4. you should upgrade to 5.x if possible. See this page for a reference:

http://tomcat.apache.org/

Originally posted by Jothi Shankar Kumar Sankararaj:
sergio,

What is the way if I want to get the request url like

<%= pageContext.getRequest().getRequestURI() %> ...How can I do this usinf EL?



I believe this expression should be this:

<%= ((HttpServletRequest)pageContext.getRequest()).getRequestURI() %>

(pageContext.getRequest() returns ServletRequest but its actually an HttpServletRequest)
[ March 27, 2007: Message edited by: Clifton Eaton ]
Apparently the difficulty you are having in IE is due to the way IE treats the localhost domain. I was able to repeat your problem and after some research uncovered this article:

http://www.techfeed.net/blog/index.cfm/2005/11/7/IE-cookies-and-localhost

It identifies the problem and then a comment on the blog gives the solution for testing... and not it's not always use firefox