yusuf nazir

Greenhorn
+ Follow
since May 13, 2009
Merit badge: grant badges
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 yusuf nazir

Hi all,

How do bind data from one state and pass it to another state.

the following code shows what i have done, but is doesn't work. I get a nullpointer exception


any help will be appreciated
13 years ago
Hi All,

I'm implementing logging within my application and it is working fine....., except the fact the it logs info from other frameworks that i am using.
How is it possible to just log what i want and not incorparate other frameworks logging info?

thanks in advance
Hi Paul,

Record does have a primary key and so does checksum

This is the record class:



this is the hibernate record mapping:


This is the checksum class:


this is the checksum hibernate mapping:

Hi All,
I'm stuck with a problem.
I want to use Hibernate Query by Example but am getting a problem with my result.
I'm querying over two tables, a parent-child situation.

I have a class called CheckSum and a class called Record.
CheckSum has a set of Record.
When i execute the query, the resultset of CheckSum is equal to all the resultset of Record.
I'm not getting a parent-child resultset.

Thus is CheckSum has {chk01,chk02,chk03}
chk01 has {rec01,rec02}
chk02 has {rec03,rec04,rec05}
chk03 has {rec06,rec07,rec08}

if I query chk02 and all his record I get a list of 3 CheckSum and in all those 3 the same amount of record is repeated.

How does query by example work with joins???

thanks in advance.

Hi all,

Im using displaytag( displaytag website )but am having trouble generating a border around the table.

this is my css

any help will be gladly appreciated

thanks in advance
Thanks Saifuddin,
it helped

try to post the war file, but just isn;t going .
i'll do it another time
13 years ago
Hi bennet,

I made the neccesary changes to dispatcher-servlet.xml


ok now i created another file called spring-views.xml. place this in the same folder where the dispatcher-servlet.xml is located.


best thing to do is to try to build is simple as possible.

spring follows a very simple flow. I'll try to explain it.
If I'm not mistaken you;re project folder is as follow:

When you're application starts up it will look in the web.xml. The web.xml has a welcome-file-list that tells spring where to start.
the welcome-file-list has a lot of addresses, but only the first acceptable one is used on implementation.
In this case it's our redirect.jsp




the redirect.jsp tells spring which url to parse to generate the requested page.
here we tell the application to always start with the index.htm url.
so spring will now activate the right controller and the is the indexcontroller because index.htm is mapped with indexcontroller in your dispatcher servlet.



your indexcontroller is simpleformcontroller as you said so it should be something like this:


This is a very simpleformcontroller that just renders a page and does nothing else. As you see constructor has been defined for loading a bean on implementation of the controller. This is also configured in your dispacther-servlet.xml where you give your commandclass. A simpleform controller is meant to get information from the page when the form is submitted. the information is thus stored in the commanclass.

you will also notice that the dispachter servlet has a formview defined as "index". so spring will load up the corresponding jsp. This is configured in the spring-views.xml

By the way. I use the following tools: eclipse europa 3.3, maven 2.0 and deploy on tomcat 5.5
Do post what you use to build your app.

hope this helps

13 years ago
Hi Bennet,

When i build spring app i use the a views file to handle the views.
for example, I have a springweb-views.xml


as you can see the xml file will handle the getting the right jsp. All you have to do is call the view name, either "continue" or "anotherView".
this xml file is placed besides the servlet and web.xml files.

this should at least help to resolve your "no resources found" error.

keep us posted if that was what you want or not.
13 years ago
Hi,

Are you using a simpleformcontroller or abstractformcontroller?

depending on that i can give you a proper solution
13 years ago
Hi,

Does anyone have a good example of implementing sitemesh with spring?
I have googled it a lot and have found some example they don't seem to work.

What i want to know if how to have a very simple app work with spring and sitemesh.
- what should be in the web.xml?
- should anything be configured in the servlet?
- what other files should be in the WEB-INF folder and how should those files be configured if my jsp pages are stored in WEB-INF/jsp/?

any help will be greatly appreciated.

thanks in advance
Yusuf
13 years ago
Hi all,

I found the solution. In case anyone needs is it you can read through it.


in jsp:
--------
<td>
<spring:bind path="klantId">
<form:select path="klantId" items="${opdrachtGeversList}" itemValue="opdrachtGeverId" itemLabel="opdrachtGeverNaam"/>
</spring:bind>
</td>

i don't think the spring bind is needed.

Java classes
---------------

public class OpdrachtGevers {

private String opdrachtGeverNaam;
private Integer opdrachtGeverId;
private String profile;

public String getOpdrachtGeverNaam() {
return opdrachtGeverNaam;
}
public void setOpdrachtGeverNaam(String opdrachtGeverNaam) {
this.opdrachtGeverNaam = opdrachtGeverNaam;
}
public Integer getOpdrachtGeverId() {
return opdrachtGeverId;
}
public void setOpdrachtGeverId(Integer opdrachtGeverId) {
this.opdrachtGeverId = opdrachtGeverId;
}
public String getProfile() {
return profile;
}
public void setProfile(String profile) {
this.profile = profile;
}
}


Java DAO class
------------------
public List<OpdrachtGevers> retrieve() {
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
String sqlQuery = " from OpdrachtGevers as opdrachtGevers where lower(opdrachtGevers.profile) not like "+"'general'"+" ORDER BY opdrachtGevers.opdrachtGeverNaam";
System.out.println("query executing");
List<OpdrachtGevers> opdrachtGeversList = (List<OpdrachtGevers>) session.createQuery(sqlQuery).list();
System.out.println("query executed");
session.getTransaction().commit();
return opdrachtGeversList;
} catch (RuntimeException re) {
throw re;
}
}
Hi all,

I'm building an application using spring mvc for the front end. I would appreciate any help as to how I can populate a select list with values.
what i have now:
=============================
<spring:bind path="klantId">
<select name="klantId">
<option value="1">test-txt-bestand</option>
<option value="2">nog te specificeren</option>
</select>
</spring:bind>
=============================

the list that i'm currently trying to generate will contain about 20 values.
How can i populate it? I'm using a mysql database for the backend.

thanks in advance