Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Yorck Zhou

Greenhorn
+ Follow
since Jan 04, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yorck Zhou

You can refer the answers for the sharpen your pencils questions in the HFE here: http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBIndex.html
transient type data is not serializable.
hi
Sand,
thank you for your reply, but i have only a

System.out.println("some string");

in the ejbCreateXyz method. this would never throw a NullPointerException.

i think there must be other thing to be set. when i deploy the application,
there is a line in the console says: the method createXyz in bean has not been mapped. what does this mean? i use JBoss-2.4.10 as the EJB container.
[ October 07, 2004: Message edited by: Yorck Zhou ]
hi,
everybody,

i have a createXyz() method in the home interface,
what is the corresponding method of this createXyz method in the
stateful session bean?

if it is ejbCreateXyz,

why my home.createXyz() always return the following error:
TRANSACTION ROLLBACK EXCEPTION:
javax.transaction.TransactionRolledbackException: null; nested exception is:
java.lang.NullPointerException
I use JBoss-2.4.10 on Windows XP, and need only have the following 2 jars
set to the CLASSPATH to make the JNDI works:
%JBOSS_HOME%/client/jnp-client.jar
%JBOSS_HOME%/client/jboss-client.jar
15 years ago
Hi, gurus,
In the Tomcat 4.1, any Bean and Tag Handler should all be in a package to be used in a servlets or a JSP.

Is it a shortcome of the Tomcat?
hi
you don't have to add the '/WEB-INF/' in the taglib-location element!
the container will add it.


web.xml
----------------
<taglib>
<taglib-uri>http://localhost/sample.tld</taglib-uri>;
<taglib-location>/WEB-INF/jsptags/sampleLib.tld</taglib-location>
</taglib>

Yes, I have also tried a uri as an argument of the getContext() method, but it is still return a NullpointerException!

In the servlet API, I found the following statement about the getContext():

In a security conscious environment, the servlet container may return null for a given URL.



So, should make any change in the Tomcat to make it work?
Thanks Anthony!
But when I tried the following fragment code in the Tomcat 4.1. It return a NullpointerException. Is it a bug of Tomcat 4.1?


try{
ServletContext rootContext = getServletContext().getContext("http://localhost:8080/";);
System.out.println( ( rootContext.getAttribute("root") ).toString() );
}catch(Exception e){
System.out.println(e);
}

in the servlet specification 2.3 there is such a statement:

To illustrate this requirement with an example: if a servlet uses the RequestDispatcher to call a servlet in another web application, any sessions created for and visible to the callee servlet must be different from those visible to the calling servlet.

oh, sorry, it should be invoked in a JSP not a servlet.
then can you tell me which one would be invoked first in a JSP:
request.getRequestDispatcher("xxx.jsp").include(req, res)
or
pageContext.include("xxx.jsp")
?
hi,
can anyone please tell me which one would be invoked first in a servlet:
request.getRequestDispatcher("xxx.jsp").include(req, res)
or
pageContext.include("xxx.jsp")
?
Hi,
I have three JSPs, they are a.jsp, b.jsp and test.jsp.
Can you tell me why the following codes run to a different result?
Please pay attention to the line "AAAAAAAAAAAAAAAA"
and the line "this is bbbbbbbbbbbbbb.jsp" in the results.
/////////////////////////////////////////a.jsp:
<br>this is aaaaaaaaaaaa.jsp
/////////////////////////////////////////b.jsp:
<br>this is bbbbbbbbbbbbbb.jsp
/////////////////////////////////////////test.jsp:
<html><body>
<br>AAAAAAAAAAAAAAAA
<%pageContext.include("a.jsp");%> <%//pageContext line%>
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
</body></html>
the output in the IE browser:
AAAAAAAAAAAAAAAA
this is bbbbbbbbbbbbbb.jsp
this is aaaaaaaaaaaa.jsp
BBBBBBBBBBBBBBBB
/////////////////////////////////////////test.jsp
//(with the line
//< %pageContext.include("a.jsp");% > < %//pageContext line% >
//deleted):
<html><body>
<br>AAAAAAAAAAAAAAAA
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
<br>CCCCCCCCCCCCCCCC
</body></html>
the output in the IE browser:
this is bbbbbbbbbbbbbb.jsp
AAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBB
thanks!
16 years ago
JSP
hi, everybody,
I have three JSPs, they are a.jsp, b.jsp and test.jsp.
Can you tell me why the following codes run to a different result?
Please pay attention to the line "AAAAAAAAAAAAAAAA"
and the line "this is bbbbbbbbbbbbbb.jsp" in the results.
/////////////////////////////////////////a.jsp:
<br>this is aaaaaaaaaaaa.jsp
/////////////////////////////////////////b.jsp:
<br>this is bbbbbbbbbbbbbb.jsp
/////////////////////////////////////////test.jsp:
<html><body>
<br>AAAAAAAAAAAAAAAA
<%pageContext.include("a.jsp");%><%//pageContext line%>
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
</body></html>
the output in the IE browser:
AAAAAAAAAAAAAAAA
this is bbbbbbbbbbbbbb.jsp
this is aaaaaaaaaaaa.jsp
BBBBBBBBBBBBBBBB
/////////////////////////////////////////test.jsp
//(with the line
//< %pageContext.include("a.jsp");% >< %//pageContext line% >
//deleted):
<html><body>
<br>AAAAAAAAAAAAAAAA
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
<br>CCCCCCCCCCCCCCCC
</body></html>
the output in the IE browser:
this is bbbbbbbbbbbbbb.jsp
AAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBB
thanks!
[ March 12, 2004: Message edited by: Yorck Zhou ]
Sessions will be expunged when we close all the window related with the sessions. A session ends when the client left the "conversation".