Balaji Manoharan Bm

Greenhorn
+ Follow
since Sep 22, 2013
Merit badge: grant badges
For More
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 Balaji Manoharan Bm

You can write
<% System.out.println(homepage.getUserSessionHelper().getUserData().getRegion()); %>

Inside these <% %> tags you can write java code in a normal way. But it is not a standard practice to write.
10 years ago
JSP
Could think of two other approches
1. Implementing the javascript logic inside ManagedBeans
2. Writing Custom Converters
10 years ago
JSF
I didn't get it fully.

Did you try mapping FacesServlet only for JSF urls?

Verify your <servlet-mapping> once.
10 years ago
JSF
Think your bean is in session scope.
10 years ago
JSF
For storing the label and value, you can think of Value Object. Then use an ArrayList to store table data as a collection. The value object provides extensibility so you can add new parameters in future very easily.

The following link explains how to use ui:repeat tag.
http://www.mkyong.com/jsf2/jsf-2-repeat-tag-example/

Your question is little unclear on where you are having problem. So have answered generally by looking at your code.
10 years ago
JSF
Thanks Henry. I have just over looked Campbell's comment.

Word boundaries make it so easy.

str.replaceAll("\\bis\\b","is not");
10 years ago
have just found my above code fails if a word starts with 'is'. So added a ^is as an or condition.

str..replaceAll("^is|(\\s+)(is)(?!\\w)","$1is not");

10 years ago
Here you go. The below pattern works to some level...

str.replaceAll("(\\s+)(is)(?!\\w)","$1is not");

This works for me for following values
input: This is good output: This is not good
input: This is bad isn't it output: This is not bad isn't it
10 years ago
Think it is answered by Ahsan above. Am putting it differently to make it simple. The problem is due to con.close() which throws SQLException and it is a checked exception and so it must be caught or thrown.

surround your con.close() like this
try {
con.close();
} catch (SQLException se){
se.printStackTrace();
}

If you copy the code and put it in a different method, you can simply understand the issue.

for e.g

public static void main(Strings[] args) {

try {
Connection con = getConnection();

} catch (Exception ex){

}

}

private static Connection getConnection() throws SQLException {

}
10 years ago
The issue is due to Old generation objects growing under load. But the root cause could be due to various reasons.

The below link will give you some idea
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html

Suspect the entities are getting piled up in application cache. Disable the second level cache and test once.
10 years ago
JSF
Give the directory name as input to getResourceAsStream() and the use File.listFiles() method to know all the files available in that directory.
Think you are testing JSP directly using .jsp URL. JSF application must have FacesServet in web.xml and it should be mapped with *.jsf or *.xhtml.

After verifying this, replace your .jsp extention with .jsf and test.
for e.g., http://localhost:7001/demoapp/page/welcome.jsf
10 years ago
JSF