Maan Suraj

Ranch Hand
+ Follow
since Dec 20, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Maan Suraj

how do we handle these characters dynamically. Say you get these values from some other source like DB etc. Also,which character set does JSP use by default? What if i use UTF-8 charset in JSPs?
sorry for late reply, but actually i got confused between encode and decode characters.It is clear up to some extent now. But need more clarity on differences between HTML escaping and URL Encoding(if there is any). I mean some egamples will help.
i am facing issues with displaying data in JSPs. In my javascript code i try to decode the value so that it can be displayed in jsp correctly.Let me take an eg here,

say in DB value is stored as

Doctor's



When this value comes to javascript ,it is encoded.






please let me know what is the issue.I tried with unescape also. Also,there are no errors on the page
hi all

i am trying to develop REST webservice. I am using the code from "http://examples.javacodegeeks.com/enterprise-java/rest/jersey/json-example-with-jersey-jackson/". I have exactly same code . I have deployed this service on tomcat7. I get an exception when it tries to invoke the service




I get an excpetion which says

"java.lang.RuntimeException: Failed : HTTP error code : 415"



I tried some other egample as well ( i think from mykong site) and got the same exception. Please help
3 years ago
sorry for late reply. Above instructions are for Eclipse (helios)
below is the solution.


[google]Project Properties -> Deployment Assembly
Add -> Archives From File System -> Next -> Add
(The file dialog of your system opens up.)
Navigate to the archive you want to include in your WEB-INF/lib, select it and hit OK.
Hit Finish.
Hit OK.[/google]
Thanks. basically it was a typo here when posting this query. In the project, it is WEB-INF folder only.Basically, as you mentioned, there seems to be some configuration issue when am building the project from eclipse, as i see that WEB-INF\lib folder is empty. However, if i do a maven build from outside eclipse, then it works fine. Earlier, i got confused between the war generated by eclipse (which is some other default folder) and the one which i generate from mvn build from outside. Having said that, i am still not sure what configuration am i missing in eclipse(since WEB-INF\lib) is empty. Please help
Hi,
I had my jars in <project>.war/Web-inf/lib, but i was getting Classnot found excpetions. Exception were related to "log4j" , "mysql". So, i moved the appropriate jars to Tomcat/lib and it started working. My questions here is that what difference does it make? I basically thought, tomcat classloader looks into 1) web-inf/classes,2) web-inf/lib and 3)tomcat/lib. But, in my case it skipped the web-inf/lib,atleast it appears like that. Any idea why
I was going through an article from the site Mykong site
The purpose of the article is to explain the inverse keyword.

I am not getting the 4th point i.e the topic which has heading

4. inverse=”false” Example



There is an insert egample

When a “Stock” object is saved, Hibernate will generated three SQL statements, two inserts and one update.

I am not getting the point why there needs to be an update at all?
Even if stock is the relationship owner what is the need of update ?

Could anyone please help me in this.
Thanks Bill..

I am new to Hibernate. Could you please let me know where should i exactly declare the annotation metnioned by you

@ManyToOne(fetch = FetchType.EAGER)

I know the basically what eager and lazy loading mean..but when i was reading hibernate refernce document ..see below excerpt


Above it says it may trigger lazy load. I dont understand why will it lazy loading.

Also the document says

This time we did not use a fetch query to initialize the collection. Monitor the SQL log and try to
optimize this with an eager fetch.



How could we change the above to eager fetch ?
I have a table structure like below

Table name :"relationship"
Columns of above table are
Parent_node, child_node,relatiohsip,Desc,other values .

The Primary key is a combination of "Parent_node","Relationship","child_node". Now say there are 2 ids given (IDs are values of "parent_node","child_node").Lets say, the id given is "100","200". I have to look up in the relationship table and find out the relationship between "100" and "200". Lets assume 100 is parent of 200."200" in turn can be parent of "300".another input sayis "100", "300", i need to still find out that 100 is parent (or say grand parent) of 300.

can below sql query correct/ improved