kalle suresh

Ranch Hand
+ Follow
since Nov 20, 2007
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 kalle suresh

Sure. Thank you. I will give a try.

Thanks,
Suresh.
10 years ago
Hi Friends,

I have the below requirement..

On each controller, immediately after the POST method is initiated I need to take the two attributes from the model and pass it to business layer.

I disregarded the following approaches

1. Either calling the business service in each controller or writing a utility class and auto wire it to controller and calling the method these process may reduce the repetitive code, but it is not effective.

2. Interceptors, are not helpful, because, I need to inject the model attributes immediately after POST method started executed.

Is there any best way to do this, without repetitive code

Thanks in advance,

Thanks,
Suresh.
10 years ago
Hi Friends,
Our project is using EJB3, JPA .I need to perform common operation (picking up data based on some criteria) across all JPA entities. I would like to isolate that logic in a base bean and all the other beans extends this base bean.
But challenging is that, I need to know the Entity instance name, and as well as the column names in the particular entity. Column names are varying from entity to entity.

Any best practice for this kind of scenarios ?

Thanks in advance,

Thanks,
Suresh.
Hi,

Those are in three different tables. All these three sections/details are displayed under one page. Is there any best practice to perform this ? I looked into Composite View Design Pattern, but it looks like it handles only similar objects, not distinct objects.
10 years ago
Hi Friends,

I have a design question in Spring 3.Here is the background..

1. Currently our project is using Spring Core,Spring MVC, EJB3 and JSP.

2. The persistent layer is through - JPA entities. We have used bottom up approach, as we have to create application using existing database,

3. The flow is like this
1. Dispatcher Servlet takes the request, passes the request to corresponding controller.

2. The controller uses the Service objects to interact with enterprise beans and create the business objects. Here business objects represent generic objects which are used across the application.

3. Value Objects are responsible for presentation layer. These objects have one to one mapping between the UI elements.

4. Mapper classes are responsible to map/fill the Value Objects from the result of Service Class calls.

5. We are creating value objects with one to one mapping of screen elements.These UI elements are the result of JPA entities. i.e., based on input from the UI, a disticnt object/row of an entity represent what to
display on the UI.

6. Currently, one UI screen contains the result of different entities. For example Employee screen contains Employee object, Employee expense details object and Employee Expense details object.
These object contains distinct elements.On top of it, Summary page contains diffent objects of these kind.

Question:-

My question is, if I create a corresponding VO for Employee, Expense, Employer, how to combine these objects. I mean, if I start creating VO's like this.. suppose if UI contains 10 different sections with 10 elements of each, data pulled from different tables, then I may end up creating a VO with 100 elements. So I felt creating VO for each section would make sense.

How to relate these VO objects from creation of VO to display in JSP. I can not come up with business objects for the sake of UI.
Is there any design pattern ?

Thanks,
Suresh.
10 years ago
Hi,

I tried changing the User to user and the properties which I am referring in xhtml as the way they are declared in bean class. But no luck.
11 years ago
JSF
Hi,

I am running sample JSF with a

1. login page asking for the user name and password.
2. after entering the user name and password, greet the user with Hello User Name..

Here are the configuration details.
1. Eclipse Helios
2. Tomcat 6
3. JSF Version 2


The following are the list of files.

1. index.xhtml - containing the input boxes for user name and password.
2. User.java - Bean having the properties for user name and password. once after entering the user name and password at index.xhtml values need to be stored here.
3. welcome.xhtml - This will retrieve the user name from user.java and put a message..


I have attached my files here.

1.index.html


2. User.java


3. welcome.xhtml



4.web.xml


5.faces-config.xml


Here are the list of libraries I am using..
javax.faces.jar
jstl-1.2.jar

I am able to see the login page and after input the user name and password and click on login button I could see the following error.






Please help me in resolving this..

Thanks,
Suresh.
11 years ago
JSF
Hi,

By mistake I placed the struts-config.xml twice. Below attached is my validation.xml

12 years ago
What is the correction under validation.xml
12 years ago
Hi,

I have written below sample program for struts validation attached here. When I submit the form, the validation is not happening. Can anyone take a look and let me know what the issue was.

struts-config.xml


validation.xml



ApplicationResources

errors.suffix=

errors.required='{0} is required'.
errors.minlength='{0} can not be less than {1} characters'.
errors.range='{0} is not in the range {1} through {2}'.

exampleForm.name=Name
exampleForm.age=Age


web.xml



ExampleAction.java



Ex1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<head>
<title>JSP for exampleForm</title>
</head>
<body bgcolor="cyan">
<center>
<html:form action="example1.do">
<html:errors/>
Name : <html:text property="name" />

Age : <html:text property="age" />

<html:submit value="Send"/>
</html:form>
</center>
</body>
</html>


Ex2.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<head>
<title>JSP for exampleForm</title>
</head>
<body bgcolor="yellow">
<center>
<html:form action="example2.do">
<html:errors/>
Name : <html:text property="name" />

Age : <html:text property="age" />

<html:submit value="Send"/>
</html:form>
</center>
</body>
</html>



12 years ago
Hi All,

Any idea on how to handle with the templates created from Quark Express 6.5 with Java and finally generate PDF using java program. As per my knowledge, desknet handles with quark templates. I am looking to handle these templates other than desknet.

Any inputs on this will be a great help for me.

Thanks,
Suresh.
13 years ago
Hi,

I am facing the following issue while running one to many relationship.

Basically my code includes,
1. COURSE table and STUDENT table.
2. COURSE will be the master table containing different course names having CNO as Course Number as primary key.
3. STUDENT table contains SNO, SNAME and CNO as Student Number, Student Name and Course Number under which student is under going.
4. Following is the piece of Code.

StudentOneToMany POJO



Course POJO



Student.hbm.xml


Course.hbm.xml


hibernate.cfg.xml


Please note these two tables are not present under database
Below is the Main Program



I am getting the following exception, tables are being created, but data is not getting inserted into the tables. please help me out


Hi,

I am not able to install Sun One Web server, experiencing the below error

Java version is too old . No luck even after installing latest version of JDK.

Thank you
13 years ago
Friends, today I cleared SCWCD 5.0 with 89%.

Here is my experience:

1. Studied HFSJ for 3 times.
2. Took around 10 mock tests which are all free.
3. These mock tests urls are mainly from the posts of the ranchers who already cleared the exam.
4. These tests helped me a lot in clearing the exam.
5. One thing I observed is, while answering the questions we should have more observation.
6. If we put more concentration, in the first shot it self we can identify which answers are completely
not applicable.
For example : To set attribute at session level, choices will be

1. <c:set attrib = "xxxxx" val="yyy">
2. <c:set attribute = "xxxxx" val="yyy">
3. <c:set var = "xxxxx" val="yyy" scope="session">
4. <c:set property = "xxxxx" val="yyy">
5. <c:set property = "xxxxx" value="yyy">

Here what I am trying to explain is that, first filter out which are all completely not applicable and from
then you will get only few which seems to be correct. Then from that pick up the correct answer.

This will save your time, and accuracy will increase.


7. This is what I learnt from my journey from SCJP to SCWCD.

Hope this helps you. My sincere thanks to Javaranch Forum.


14 years ago