Tony suankularb

Greenhorn
+ Follow
since Aug 10, 2009
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 Tony suankularb

I'm a newbie to Portal and Portlets (also, javascript and css).

When I create a portlet, I put css files and javascripts files in a folder of the portlet project.

So, I configure liferay-portlet.xml like this

<header-portlet-css>/MyJavaScript/jmodal.css</header-portlet-css>
<header-portlet-javascript>/MyJavaScript/myscript.js</header-portlet-javascript>



My question,
1. I've heard that it's not a good idea to put my own javascript to the project's folder. For example, other porlets cannot reuse the script.
So, where should I put my Javascript and also CSS files?

2. Sometime, the CSS of a Portlet affects the Portal theme's CSS when selector names of them are duplicate such as body{} of portlet css and body{} of theme css. How can I avoid this problem?

3. Also, when I add some new portlet, I cannot click on the liferay menu or the browser get minimized. I thinks it's because of Javascripts of portlet affects the liferay portlal. Do you know how to avoid this problem.


4. Now, I'm developing portlets on eclipse and use Ant to export War Files to the Deployt folder of the liferay. Then, I manually add portles to the page and test if they work.

This really is a time-consuming method and I cannot debug my portlets. I've not found any way to run and test portlets on Eclipse. Is there a plugin or a ways that allow me to do that?

Thank you
12 years ago
Sorry, I couldn't write the code to test it myself. Some problems on my laptop.



Suppose body-content of a tag is tagdepedent

<body-content> tagdependent <body-content>


If Scriptlet or EL is passed as the body, what will happen? The Scriptlet or EL will be treated as text or Error?



similar question. body-content of a tag is scripless

<body-content> scriptless <body-content>

If Scriptlet is passed as the body, what will happen? The Scriptlet will be treated as text or Error?






I know only how parent tag access its child tag's attribute in Classic Tag

Source code from HFSJ

JSP



child tag: MenuItem





In the parent tag: Menu


As far as I understand, the body content is evaluated between doStartTag() and doEndTag().
So, doEndTag() can access its child's attribute.



But, what about Simple Handler Class which has only doTag() method
How can we know the child's attribute is available for the parent. I means in the simple tag, when the body content is evaluated.

All I know is getJspBody().invoke(writer); of Simple Tag can write the body to a writer
Thanks, Ankit and Christophe


I found Ashok's API note

The note is based on J2EE 1.4 API.

Is it ok for the latest version of SCWCD?



Thanks
I wonder if I need to memorize what classes and Interfaces a class extends and implements.

For example,
Servlet<-- GenericServlet <-- HttpServlet

Tag <-- IterationTag <-- TagSupport


I wonder if I need to know which super class a method is inherited from?


For example,
getInitParameter() of HttpServlet is inherited from GenericServlet


Assume Employee extends Person

<jsp:useBean id="person" type="foo.Person" class="foo.Employee" scope="page">

I understand that if person object does NOT exist, a bean object would be created using the reference type.
like this

foo.Person person= new foo.Employee()


What if the bean object already exist, will it assign the type "foo.Person" to the existing object?
Assume that the client's browser enable cookies.

If a container receive the first request and return a session id cookie in the first response.

As far as I remember, for the next requests, the container won't send the session id to the client again.


I'm confused because at the bottom of page 238 of HFSJ, it says about the second request from a client.

"the Container reads the session ID from the request, finds the session, and thinks to itself, “This client accepts cookies, so I can ignore the response.encodeURL() calls. In the response, I’ll send a cookie since I know that works, and there’s no need for any URL rewriting, so I won’t bother...

I'm confused between Web Servers and Web Containers. I understand what a Web Container does.

But, I don't know what else a Web Sever does, aside from getting requests/returning response from/to clients.

And, is Tomcat just a Web Container or also a Web server?
Today, I’ve just passed SCJP with 93%. The score is not perfect, but at least, I don’t have to study for SCJP anymore. So, happy.

The real exam was not very difficult as I imagined, but you need to be well prepared.

Also, to whom that may be frustrated during preparing for the exam. Don’t worry. You’ll be fine.
(here is the evidence https://coderanch.com/t/466416/Programmer-Certification-SCJP/certification/questions-real-examp-harder-than#2085110)

My tips
1. Finish sierra and bates book and take your own note.
2. Review your note.
3. Review two-minute drill and redo the self-test questions in each chapter.
4. Do Master exam, review your wrong answers, and take a note
5. Do ExamLab, review your wrong answers, and take a note
6. Review your notes from step 4 and 5
7. Register for the exam and take it!!

My additional suggestion is that first, you should finish only 2 tests of the Master exam and save the last one for later. Then do the ExamLab. After that, finish the last Master exam.

Why?
Because the Examlab is very very tough. Yeah, Devaka and many people in this forum keep telling us that

“Don’t evaluate yourself with ExamLab(or any Mock exam) scores.”

Anyway, sometimes, we can’t really avoid evaluating ourselves with those scores. Not many people got high score in Examlab. Your scores in Examlab may discourage you.

However, the ExamLab is really helpful and you MUST do it. After finish each test, review your wrong answers and learn form your mistakes.

Finally, do the last Master exam test. I bet your score would be higher than the first two Master Exam tests. This help encourage you before the real exam.

In my opinion, the difficulties of each exam in numbers
Examlab = 10
Master Exam and self-test = 8
The real exam = 7



Here is my mock exam scores.

Master Exam
Test1 68.06%
Test2 63.89%
Test3 68.06%

Average 66.67

ExamLab
Diagnostic 56%
Practice1 48%
Practice2 59%
Practice3 61%

Average 56%


Thanks
Sierra and Bates for the wonderful book
Devaka for the great and helpful Mock exam
Everyone in this forum. I’m an inactive member, but I always read threads in this forum.

12 years ago
for example,



this code doesn't import java.util.HashMap;. In a real program, it won't compile.

But, I wonder in the real exam, is this code also considered "compilation fails"?


If yes, is there a lot of this kind of question in the real exam? (I saw a few question about not importing class in master exam)

The problem is I don't remember what classes are in java.lang. (imported by default)