andree surya

Greenhorn
+ Follow
since Jun 13, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by andree surya

Ok. Thanks for your code and advice, Mike !

14 years ago

Ninad Kulkarni wrote:@ andree
Suppose if we handled SQLException in clearParameters() method is that good idea to handle it there?
Let see what other will say about it.



Thanks for the response Ninad.
I forgot to mention that getByIdStatement is a PreparedStatement object, included in the Java standard library.
I need to call clearParameters() method to the the object because it will be reused later.
14 years ago
Hi there,

I just want to confirm if I've done this the correct way.
I have a code to fetch a record from database, given the ID of the record.



The problem is, apparently the clearParameters() call in the finally block throws an SQLException.
I managed to solve this by putting another try catch clause inside the finally block.



Problem solved, by I hate this. Exception handling is cluttering up my code !
Can someone give an advice, how should I solve this problem? Or this is how it is, and I should just leave it be?

14 years ago
Thanks guys for the help. But honestly, I'm a bit overwhelmed since I'm not yet that much into Java

However, I understand that JSF doesn't go well with JSP, so I decide to remove those JSP scriptlets, and use something like this instead:



Nevertheless, thanks for your time and effort .. I appreciate that
14 years ago
JSF
I have a set of categories and I want to display that as hyperlinks in my JSF page.
If the user clicks in one of them, the category ID is submitted and the action BookController.filterByCategory is called.

This is my code:

And when I browse the page, apparently it doesn't work:

Can anyone tell me the correct way to do this?

Thanks,
Ang
14 years ago
JSF
Ah, it's okay. I just found out about <f:subview> tag.
14 years ago
JSF
Hm .. I can't find any relevant information. But it's okay, now I'm using jetty and it works (I'm in hurry).
Thanks for the response, anyway !
14 years ago
JSF
Hi there,

I have 4 JSP files: header.jsp, content.jsp, sidebar.jsp, footer.jsp
In content.jsp, all 3 other files are included:

The problem is, I want to put a JSF form on each sidebar.jsp and content.jsp.
I want to achieve this by putting <f:view> tag on each file, but apparently it doesn't work.
Only one form appear (in sidebar.jsp), so I assume that in one page there should be only one <f:view>.

So I took the extreme approach: I put <f:view> opening tag in the top most of header.jsp and </f:view> closing tag in bottom most of footer.jsp.
But it doesn't work either. Jetty compalins that <f:view> tag doesn't have a closing tag in header.jsp.

Can anyone help me here? Basically I just want to have 2 JSF forms in one page, but in separate files.
14 years ago
JSF
Still the same error, without complain about servlet.jar.
14 years ago
JSF
Thanks Tim, but .. Still, it doesn't work. More clue?
14 years ago
JSF
Hi guys, please help me with my problem here.
I have two similiar web application, one can be started by tomcat, and another doesn't

One is under webapps/book_store folder, which is working correctly.
Another is under webapps/book_store_jsf, which is almost exactly the same application (except the project name in build.xml), which can't be started by tomcat.

This is the console log when I start the tomcat server:

book_store can be accessed, but book_store_jsf doesn't. Can anyone find out what am I doing wrong here?
I'm aware that in line 16, the log tells me that tomcat doesn't like my servlet-2.3.jar. I've deleted the file, but still it doesn't work.
14 years ago
JSF
Okay, I think I'll go with the /lib. Thanks for the input !
15 years ago
Currently I'm working without IDE, and I configure the classpath manually inside the ant build file.
I set my compile classpath by including every jar files inside /web/WEB-INF/lib. So it's okay and common to do this? I don't need to create a separate /lib directory?
15 years ago
Hi there,

I've been learning java web for several weeks and I always use "/web/WEB-INF/lib" as my compile classpath. Well, I don't feel right doing this, because I think that's not how "/web" directory supposed to be used. Recently, I see an example on the Internet that uses "/lib" (directly under root) as its compile classpath. However, if I do put my library (e.g. JDBC driver) under "/lib", still I have to put that library under "/web/WEB-INF/lib" for runtime usage, so the file will be redundant.

So basically my question is, where should I put external libraries?

Thanks,
Ang
15 years ago
Hey, it's working now but I'm not sure what do I did to fix this. Maybe because I'm restarting the tomcat server.
15 years ago