Win a copy of Spring Boot in Practice this week in the Spring forum!

Timotius Pamungkas

Greenhorn
+ Follow
since Feb 26, 2005
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 Timotius Pamungkas

In some websites (let's take yahoo mail for example), when we want to register as new user, the site (yahoo) give us a distorted image, and we must enter string in that distorted image to validate us.

Actually, what is it for?I suggest that's for security (maybe to avoid something like "auto-register-bot"?). Am I correct?

What is the logic behind such a security prevention? How can we implement it using JSF?

Thanks
14 years ago
JSF
Works fine...

I access the ServletContext via FacesContext.getCurrentInstance()

Thanks for the answer
14 years ago
JSF
Hi all,

Can I read a file under WEB-INF and put ir into java.io.File?
I've tried following code, but the file.exists() always returns false. What can I do?






I need the file to be read from my backing bean (as static property in backing bean)
14 years ago
JSF
HI

I'm just learning EJB3, and I want to know, can my entity classes used to generate DDL?
I've tried to find article or tutorial about this, including the steps to generate DDL from entity classes, but can't find any. Can anyone help me? Do I need another jar other than glassfish-persistence jar?

Thanks
I suggest you take SCJP. I never took SCJA (well, I guess Sun had not released SCJA on 2005). SCJP will helps you gain basic skill required for Java Programmers, but I don't know about SCJA

Regards,
Timotius Pamungkas S
SCJP 1.4 - SCWCD 1.4
15 years ago
Dear all

What is Model Driven Architecture? Is it different with Unified Software Development Process? Both use UML, aren't they? I found spec for MDA at www.omg.org, but can't find any spec for USDP.

As a Java Developer, which one should I understand? The MDA, or USD?

Thanks


A couple of points:

1 - Sun DOES attempt to shut these illegal sites down - they're like weeds



Microsoft does (did???) too...

http://tcpmag.com/news/article.asp?editorialsid=1085


Timotius, if you feel you learned, then there shouldnt be any issue. In addition, you have the cert to show for.



Well, I guess you're right. See the good point, now I know that there is HttpSessionBindingListener which I can use...

Hopefully someone from SUN read this topic, and maybe they can implement my idea -1000 questions database (1000 is enough anyway, no such normal human being can memorize them precisely)-, but, as Roseanne Zhang's post :

It is market economy any way!!!



Personally, I'm just glad that I spent more time on snippets rather than working on mock exams.

OK guys, thanks for your attention...
I found the book quite helpful, although for I still have to find another resources for JSTL, Custom Tag, and Tag files.

Plus, the book doesn't mention anything about env-entry, ejv-ref, ejb-local-ref, ejb-resource-ref, resource-env-ref, and jsp-property-group

But overall, in my opinion, it's nice.
Hi all,

I've just passed my SCWCD this morning (84%), but quite dissapointed.
I was prepared my SCWCD exam for about 2.5 months: read study guides, creating snippets, and of course mock exams.

One thing that makes me disappointed is a [particular mock exam]. I've downloaded [this mock] exam, and read it once or twice. But when working on my exam, I realized that some exam questions (quite a lot actually) are very similiar with that mock exam (or maybe even exactly same).

Okay, I found myself passed the exam, but studying from that [mock exam] seems like peeping a cheatsheet. Comment about [this] mock exam seems right -learn it for 12 hours and you'll pass your exam-. Someone doesn't have to develop JSP/servlet for months, reading that manning study guide, or create a lot of snippets to pass the exam. Download that [mock exam] (it's free anyway), read it for three days, and pass the exam.

Come on Sun...
You've created JSP, JAXP, EJB, and all those Js, but you can't create a database for exam. Say, 1000 questions, 70 of which taken randomly for candidate's exam... How difficult it is for Sun? I think even a non Java developer might pass SCWCD if they have that mock exam and good memory. From that 80-pages-and-about-120-questions-mock-exam, a person can pass SCWCD.

The (more) funny thing is : my mock exam was released on 2005. So I assume in two years, no changes for SCWCD question??

One more thing...
About that free retake exam... Hey, this is developer's exam, not chocolate for christmas. Sun offer's for that retake exam -at least for me- seems like Sun said, "Come on developers, take your exam, and do not worry if you fail cause you'll have another FREE chance. So come on and do a trial... You fail on trial, at least you know what is Sun's exam looks like, so find another month and re-take it FREE".
Come on Sun...
If you really want to help us saves our money, give us 50% discount on our second attempt, but don't offer that free retake exam as if you exam is a worthless thing...

Regards,
Timotius Pamungkas

SCJP 1.4, SCWCD 1.4, towards OCA
[ May 26, 2007: Message edited by: Marilyn de Queiroz ]
Hi all...

I encountered following error (HTTP status 500) during development :

....
javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:407)
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:294)
....


And this is due to following snippet in jsp


<html:select name="peopleEntryPsychotestResultForm"
property="psychotestInstitute">
<html ptions name="peopleEntryPsychotestResultForm"
property="psychotestInstituteValues"
labelProperty="psychotestInstituteLabels" />
</html:select>


The problem is in labelProperty. If I removed that attribute, it works (at least, it display desired page). The problem is combo box labels are not defined correctly.
I've checked psychotestInstituteLabels, and it contains correct values. Even if I write tag "property = "psychotestInstituteLabels"", it displays correct value. But when I'm using labelProperty, it becaomes messy.
What happened? In other pages that uses html:select, all labelProperty tag works just fine, only in this page it becomes bad.
15 years ago
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I believe there is no direct means to achieve this using validator-plugin. Either you can store the javascript generated from validator into a static script file and modify the validation function or you need to write your own javascript function to do this. I am not sure what you meant by forward to another window. Did you mean opening new window or just submit the form and refresh the content on the page?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I mean, when user click "Yes", it will replace current page (same window) but when user clicks "No", it will bring user back to current page(without any changes on already-inputted data)

The actual problem is, I need to validate whether someone's name already exists in database (CMIIW - server-side-validation). If it is exists, the system will ask user whether user wants to continue with current person (that already exists in database). What should I do? I thought I can use following flow :

1. put validation in jsp (call by something like isExists = validator.checkPersonExistence(name, townOfBirth, dateOfBirth) ). In this case, isExists may vary (I have 6 different values based on validation).
2. based on isExists, if it is not 0, display appropriate confirmation window. In this window, if user answers yes, replace page with second page. If user answers no, rreload current page (just close the confirmation window). Now, I don't know how to do it using JSP. I can retrieve isExists correctly, but I stuck here. So I think maybe Struts can answer my problem rather than using only pure JSP and JS. JSP can get isExists, but cannot open confirmation window while JS do vice versa.

Any suggestion?
15 years ago
Hi all, I'm quite new in Struts, and I'd like to know how to display error message. I found that ActionForm.validate(ActionMapping, HttpServletRequest) can be used for validation purpose, but I don't know in which part to show my error message. My validate() looks like this :

public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

ActionErrors errors = new ActionErrors();
int errorIndex = 0;

if (request.getParameter("myParam") == null || request.getParameter("myParam").length == 0) {
errors.add(String.valueOf(++errorIndex), new ActionMessage("Zero-length param encountered"));

}

return errors;
}


I've already debugged my ActionForm, and it's true that errors contains ActionError, but the message never displayed.

Another question, in case I'd like to display a "yes/no" message, such as "Zero-length param encountered. Continue process?", what should I do? If the user chooses "Yes", system will forward user into another window, otherwise, system will reload page.

Thanks in advance.
15 years ago
Hi...

Just wonder, which approach is better?
I have two classes for database connection (standard, non servlet java class) : apache/dbcp-based DBPool and class DBConnection that retrieves and returns connection from pool, execute queries, etc.

Now, when I'm trying to use web app using JSP/servlet, should I recode them into DBPoolServlet (and get usernames, password, driver in it's init() method) and DBConnectionServlet, or just use them as is (non-servlet-class)? What is the cost-benefit?

Thanks
15 years ago