jr gil

+ Follow
since Jan 14, 2003
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 jr gil

The JWebPlus mock exam made this statement to explain one of its answers.
TagSupport implements IterationTag. Therefore, doAfterBody() will be called if the handler extends TagSupport.

However, it looks like the default return value for the doStartTag() in TagSupport is SKIP_BODY. If doStartTag() returns SKIP_BODY, will the body then not be evaluated and the next method called would be doEndTag()???
It doesn't seem like JUST because we extend TagSupport that doAfterBody() is guaranteed to be called.
Any Ideas ???
Question ID: 996171458475
Which of the following classes provide methods to write messages to a log file ?
2 correct answers.
1.) GenericServlet
2.) HttpServletRequest
3.) ServletContext
4.) Only GenericServlet
I marked 1 and 4. It said I was wrong. Correct answer 1 and 3.
Isn't ServletContext an <<interface>> like HttpServletRequest is an interface, not a CLASS !!
I don't think it is a typo. But yet for the deploy
ment descriptor(web.xml) file it does have the ?> at
the end.
I am not a strong xml person so I don't know why that
is. Anyone???
Perhaps it just builds on some of the basic functionality tied into the
lifecycle methods built into the servlet interface. Servlet also provides the getServletConfig() which can be used in cases where you want to access init-param from the web.xml file inside the jsp.
JspPage adds the jspInit() and the jspDestroy() methods which are invoked by the container for the lifecycle methods instead of the servlet init() and destroy() but my guess is that it still uses some of the "behind the scenes" functionality used by the original methods.
Just A Thought...
I also found that problem with the init(). I am using version 4.1.18. I finally used getServletContext() and the log() to write whatever I needed in the log. A bit of a pain to have to shut down Tomcat to look at the log but it told me what I needed to know at the time.
I will look at that part of it a little closer and see if I see anything. Thanks for the reply !!!
15 years ago
<jsp:useBean id="BoltsBean" class="parts.BoltsBean" scope="session" />
<jsp:setProperty name="BoltsBean" property="*" />
I seem to have the appropriate setters and getters in the BoltsBean class. From this jsp page I <jsp:forward /> to another page which does <jsp:getProperty /> on one of the named properties and it displays the value properly.
I also have a HttpSessionAttributeListener configured in the web.xml file. The attributeAdded method is notified and I seem to be able to retrieve the BoltsBean object by
public void attributeAdded(HttpSessionBindingEvent se) {
HttpSession hs = se.getSession();
String name = se.getName();
BoltsBean bb = (BoltsBean)hs.getAttribute(name);
At this point bb is not equal null(I checked), however if I try and do the getter method on the property the method returns null.
Any Ideas ???
15 years ago