sachin pachpute

Ranch Hand
+ Follow
since Aug 05, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sachin pachpute

In my spring, JSP based application, user is entering free from description in the text area. But when data is saved and displayed on the next (read only) page, entire text is wrapped in to single para. I want whole text to be saved as user enters it along with line spaces, newlines, tabs etc.

eg is as below.

below entered description when saved will get wrapped in to a single para and will not be dispayed as it looks below.I have posted this question on other forums and also tried finding solution online so please help.


Books in the stack are

Spring
Hibernate
jQuery
mySQL
Hi,

I am getting filtered 'Trainer' entities, but collection (trainedMonkeys) is not filtered. 'trainedMonkeys' variable is holding all 'Monkey' objects instead of holding only the one with 'isThumb = true'.

Can someone please check if below criteria I am using is correct?




Trainer.java


Monkey.java


I am executing below code in the controller,


and the output is as below (Text marked in RED is not expected as it is marked as 'isThumb=false' in the database and hence should not be shown. Please suggest...),
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>
Trainer ID*****88
Trainer Name******TrainerSachin
Monkey ID*****87
Monkey Name*****Monkey_1

Monkey ID*****88
Monkey Name*****Monkey_2
Monkey ID*****89
Monkey Name*****Monkey_3

<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>
Trainer ID*****89
Trainer Name******TrainerVinod
Monkey ID*****90
Monkey Name*****Monkey_5

Monkey ID*****91
Monkey Name*****Monkey_6
Monkey ID*****92
Monkey Name*****Monkey_7

<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>



12 years ago
JSP
Hi,

I went through the hibernate doc and not able to figure out if I should use bidirectional or unidirectional one-to-many relationship.

Each product has three images. My requirement is, I want to get all the products, loop through it and only display 1st image (along with product details).

should i be using unidirectional or bidirectional one-to-many relationship? I went through the hibernate doc but still not clear.


-- Table schema

|---------------------|
PRODUCT
|---------------------|
id
number
Expiry date
|---------------------|


|---------------------|
IMAGE
|---------------------|
id
image url
|---------------------|

Hi,

I have spent a couple of hours finding solution online but in vain. Please help.

Article.java


Each Article has 3 images in Image table and hence I am CORRECTLY getting 3 rows. I want to filter records to match criteria "where Image.IMG_NAME like ("%_0.jpg")". You can see I tried using both "WhereJoinTable" and "FilterJoinTable" but it is not working.

Query I can see on the console is,


This is a correct behavior but I want to add 'where' clause to get only one record (with image name ending with "_0.jpg").

Tables,







It is just not working. Please suggest. Let me know if are more details are needed...
ok.. the issue is resolved with the version update to 3.1.1

12 years ago
I was going through Spring version changelog and noticed below line for version 3.0.4

"* WebDataBinder and @MVC request params detect and introspect MultipartFile arrays as well"

looks like I need to upgrade to latest version as i am using 3.0.1

I should have done this any ways to avoid any version issues.. lesson learnt!!!
12 years ago
I referred to below posts as well and they havent done anything different.. Can't seem to find what is the issue. Can someone help please? Am I missing something?

http://www.bitspedia.com/2012/05/how-to-upload-multiple-files-using.html

http://stackoverflow.com/questions/2017807/spring-3-upload-many-files

12 years ago
I am trying to upload multiple files using spring 3, it is picking only the fist file. I browsed through a few posts available online but didnt get clear solution.

JSP


Bean


Controller


dispatcher-servlet



I earlier tried below in JSP but it gave me error...


12 years ago

Thanks Bill. I could work on this piece only yesterday and it didn’t even take an hour. Never thought it would be that straightforward

Another good example I found was,

http://www.developer.com/java/web/article.php/10935_3830886_2/A-Pagination-Technique-Using-Spring.htm
12 years ago
Hi Bill,

I am using jsp, Spring 3, Hibernate and MySQL. I am retreiving article list from service and displaying on jsp page. Implementation is something like below,

Controller code


on my JSP, I am displaying

ArticleTitle
ArticleRent
ArticleDescription
ArticleUserFirstName
ArticleUserLastName
ArticleImage

etc....

How to set list in PageListHolder and how to use it in jsp? I want JSP to have buttons like Next, previous, 1, 2, 3 like we see on most of the applications for going to next page, previous page or specific page.
12 years ago
I want to incorporate pagination in my spring 3 MVC application. Is there any standard pagination component spring provides?

Any good example I can refer to?

Thanks,
Sachin
12 years ago
This problem is resolved for me now. Just read the document at http://docs.jboss.org/hibernate/validator/4.0.1/reference/en/html/validator-usingvalidator.html

I added,



before

12 years ago
Details given below. Please note that validation is working fine for Article (only few fields I am validating for now), but isn't working for User which is referred from Article.

Article.java



User.java



ArticleController.java



relevant snippet from despatcher servlet (for JSR 303 & messages) is as below,



addArticle.jsp

12 years ago
Hi,

In my application I want to validate the field which contains reference to another domain object (Address in this case). I am able to validate name and age fields, but not able to validate fields from Address class (no message is displayed on jsp).


12 years ago
Hi Ken,

I am completely new to Roo so am I missing a big thing here?

What does is mean to a developer who is working on Spring3 MVC & hibernate with Eclipse IDE and does not know Roo? I have started developing application a month back and now came across this post.

I am still not getting my head around on how can I make use of Roo in my application(or should I at the first place)?
Do I have to start all over if I want to learn Roo?


Thanks
12 years ago