Omer Haderi

Ranch Hand
+ Follow
since Sep 27, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Omer Haderi

Just for reference

As of JSP 2.0 it is illegal to refer to any class from the default package.

Therefore all classes that are referred by JSPs must be at least in one package!
first NOT both interfaces are in the same hierarchy so ServletRequest is parent of the HttpServletRequest.

second the HttpServletRequestImpl implements the HttpServletRequest not the ServletRequest.

therefore you can pass to the doFilter() an object that implements the HttpServletRequest interface since the HttpServletRequest is a child of ServletRequest and since we know that the filter we created is for the http protocol (web app) the cast is safe.
hi

the answer is C and E. Maybe there is a typo!

A, B and D are wrong because all of them add something to the books list and the list is NOT empty.
if your code compiles fine and you get the error at runtime then the problem must be in your jsp. When container tries to compile the jsp at runtime it does not find any import statement for the PersonBean. You should import the PersonBean in your jsp with the page directive.

The code looks fine (it should be better in package) ex:


do the following in your jsp: <%@ page import="com.example.model.PersonBean" %>

must work!
try to compile by adding to the classpath the (.) dot operator

ex: javac -classpath .;classes;C:\programming\apache-tomcat-5.5.27\common\lib\servlet-api.jar -d classes Test.java
It implements ServletConfig which has a method getServletContext()

so there it is!
the spec is clear about setHeader "the values are cleared and replaced with the new value"

therefore all values will be cleared
the following code: should get you to the root of the server: http://localhost:8080/index.jsp

HF page 136, relative paths:
if the path starts with the forward slash / then the container builds the complete URL relative to the web container itself
if you do NOT provide the forward slash / then the container builds the URL relative to the original request URL

the spec does not say anything about the forward slash!!!

maybe you do not use the forward slash

enjoy!
Hi,

make sure you throw RemoteException in all methods that you expose.
(methods of the class that extends the UnicastRemoteObject and implements the MyInterface)

99.9% that is your problem...

hope to help.
cheers.
Aloha...

There is no such thing in java int[][] a =new A[5][]...

If you mean int [][]a = new int[4][]; then you can use it like this in the enhanced loop:


PS: is it difficult to separate the words when asking questions ?

cheers!
Hi Juwonlo,

you probably need to reconstruct your question...
dynamically getting and sending some value (whos maximumlenghtyou dontknow)to send to the method ... because this does not make any sense.

cheers...
Hello Michael and Thomas,

Thank you for giving us the opportunity to learn more about this technology.

There are like thousands of Java web frameworks and "every" day we see new ones, so my question is what makes the JBoss Seam needed in a field where there are so many other "same" frameworks?

Best Regards,
Omer
[ June 05, 2007: Message edited by: Omer Haderi ]
Hi Mohammed,

First of all the "==" tests if the two references point to the same object. So in code 1:

Str and lStr does not point to the same object because when you use the "new" operator a new object is created rather than looking in the String pool, so there are two different objects and therefore false.

in code 2:

Str and lStr ( Str = "A"; lStr = "A"; ) points to the same value in the String pool so the "==" returns true.

the book of K&B have a nice explanation for this.

Cheers.
[ May 24, 2007: Message edited by: Omer Haderi ]
Hi madhu,

The reason that you can NOT assign primitive to array lies to the fact that arrays are objects even they are declared as primitives the array itself is an object and therefore it is not possible to assign primitives to objects.

Cheers,
Hello Ahmed,

Have a careful look at static blocks,

static blocks run once when the class that they are defined is first loaded.

So the JVM loads the classes first and hence the "r1" is printed, then the System.out is called which prints "pre", the constructor is called who in turn calls the super class constructor, so the "r2" is printed and then the constructor prints "hawk".

Cheers,