Win a copy of Head First Android this week in the Android forum!

Henry Zhi Lin

Ranch Hand
+ Follow
since Nov 04, 2008
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 Henry Zhi Lin

veeresh soni wrote:I think you do not have all jar files required please check

problem sovled. I did not included all Jars.
11 years ago

I am a newbie for Struts. I download the latest struts. I tried to follow the struts 2 hello world tutorial from apache doecument. I used Eclipse and Tomcat 5.5. But the helloworld.jsp always complaint on <%@ taglib prefix="s" uri="/struts-tags" %>. It saids can't find the file.

I have copied the struts2core.jar into WEB-INF/lib/. the following is my web.xml file

I have not sure what wrong with my setting why the JSP is complaint and refuse to find the /struts-tag file?

Can someone explaint to me please.

11 years ago

Ankit Garg wrote:

The HTML shows list['0'] answer is :

So my question is why this time the single quote does not work with second program.

Did you set an attribute named list in any scope??

I guess you are right I forgot to set the attribute to request, that is why

The HTML shows list['0'] answer is :

return nothing, thanks.

So I think the answer is no different between single quote and double quote in my example!

I just finish chapter 8 from Head first Servlet and JSP book. When I am doing the mock test ater this chapter I encounter the following question:

Given that a web application stores the webmaster email address in the
servlet context initialization parameter called master-email.
Which retrieves that value? (Choose all that apply.)
A. < a href='mailto:${initParam.master-email}'>
email me </a>
B. < a href='mailto:${contextParam.master-email}'>
email me </a>
C. <a href='mailto:${initParam[‘master-email’]}'>
email me </a>
D. <a href='mailto:${contextParam[‘master-email’]}'>
email me </a>

The answer is C

Note here it used single quote, I have tried the double quote as well it works here.

But whenI tried the single quote the following code it returns null to me

The HTML shows list['0'] answer is :

So my question is why this time the single quote does not work with second program. Does it mean it can only use with initParam

WHat the difference between the usage of single quote and double quote here?

Thanks for any answering first!

fascinate, seems no one can answer my question?
12 years ago
I personally found this problem as well. I was able to pass a SOAP call to the server, but when I try to see the wsdl file in browser, I see same error message "ClassNotFoundException". If you are carefully reading the whole error message you may found that message will pointed out which class is missing in your path. I have found out that my colleague add a class import path in one of the build class, but the actual class is not in the path.

I guess this maybe that java SOAP client does not need to use wsdl to parse your method SOAP request. I am not sure on this so I am happy if anyone can point out I am wrong and correct me. I also have another example, which I have import java.sql.Connection as one of my SOAP server's method parameter. I can still see the wsdl file and pass in any SOAP call, but when other platform user use it to generate client from it, it simply does not work. Because java.sql.Connection is not a java bean class, it require serialization and deserialization. Once Axis does not recognize its type, it add an anytype and http://java.sql namespace in your wsdl. This caused my wsdl did not work for other platform.

So from my examples, I can feel that when java client calling java server by using SOAP, it seems can figure out a way to parse your soap xml message and does not neccesarily use wsdl. Hope this may help you!
12 years ago
Hi guys,

I am a very new to Axis and SOAP. I recently working on a Axis SOAP poject, I have create a SOAP server and need to create SOAP client by using java. The probem is when I get the response value from SOAP server I get a exception that "No Deserializer found to deserialize a ...".

The following is my code,

I understand that the return value if it is not java bean format may require deserialized by your own class which you write a class extends org.apache.soap.util.xml.Deserializer and org.apache.soap.util.xml.Serializer. But this return value Product is in java bean format. So I have out of idea why this isn't working? Can you guys give me a hint why the application behave like this and how to resolve the problem? Do I have to write a serialize and deserialize class my own? How do I deploy it to the project?

Thanks very much!
12 years ago

Ruben Soto wrote:The reason is that if you throw SQLException you are throwing a checked exception which is not declared by I1.m1() method, and if you throw IOException you are throwing a checked exception which is not declared by I2.m1(). When you implement I1 and I2 your m1() method must properly override both I1.m1() and I2.m1(). For that, your method must not throw any checked exceptions in this case (since there is no checked exception which is a subclass of both SQLException and IOException.)

Ruben, thanks for your brief explaination.

Problem solved.

This question is from enthuware

Consider these two interfaces:

interface I1
void m1() throws IOException;
interface I2
void m1() throws SQLException;

What methods have to be implemented by a class that says it implements I1 and I2 ?

A Both, public void m1() throws SQLException; and public void m1() throws IOException;
B public void m1() throws Exception
C The class cannot implement both the interfaces simultaneously as they have conflicting methods.
D public void m1() throws SQLException, IOException;
E None of the above.

The answer is E.

I understand it's explaination on this question. But it did not explain why D is not right. Can someone explain to me why D is not right?

The following question is from enthuware

The answer is true true true false true

My question is why 4 and 5 are different can someone gives me an explaination.

Thanks first.

hi guys,

I am very new on JSP, I recently try to make my JSP code work but I got an error.

I had a Hello.class java class file in web/WEB-INF/classes/co folder. I imported and try to use in my test.jsp file. It shows the following error message.

my JSP code is like the follows

I think there maybe something wrong with the directory path setting. The jsp can't find the right class. But I have no idea how to correct it. Hope someone can help me.

By the way I am using eclipse. My workspace is in D:\workspace. The project is WebService1 there is a sub directory called web and contains META-INF and WEB-INF.
The following is my service.xml file.

12 years ago

himanshu kesarwani wrote:i am getting 65% in k&b tests given at the back of each chapter.......every one says that scjp 5 is simpler than k&b i think i can get pass at least.....!!
i just want to get tghe certification immaterial of what my % is.....
next month i hav to take the exam so kindly , SUGGEST ME ANKIT WHAT SHOULD I DO!!
Till now i was thinking even 65% is ok as real exam is easier than the mocks.....and the toughest questions are in K&B.

I suggest you to use Ankit's link to do most the mock exam, it will only do good for you. And I personally do not think that the books exam are all in real exam sytax and format. And as you said you will take exam next month, there still time, try harder and push harder I believe you will pass then.

himanshu kesarwani wrote:HELLO,every one i need your help i want to know is 65% or 59% sometimes in k&b tests in the book is sufficient to clear scjp 5.
one more prob is there i m not getting any where the LIVING drag n drop QUESTIONS,i am sick of just reading about them i want to solve them...before exams!!

I believe you definitely need more mock test before you go to the real one. Your score number does not seem impressive.

sharon daze wrote:Anyone please explain me why this code always goes into catch even exception is not thrown.

That's the bit of code causes your exception. String index start from 0 to String.length() -1, and you pass String.length will result index out of bound exception.

Ankit Dhebar wrote:Hello Can anyone please explain me the below code step by step otherwise It becomes difficult for me to understand.

Thanks !

I do not believe ask anyone to explain the format and printf is a good idea, what you need to do is read the specification first and try to run the code yourself and memorise and understand the result.