spring

Separating service layer from web layer in a Spring application

I am currently learning Spring. So far I have created a basic application consisting of Hibernate/JPA entities, DAOs and classes that perform business logic. This I am calling the service layer. If I now wish to use SpringMVC to add a web front end to this application, how should I separate the two? i.e. do I need to create a separ...

hbm files in hibernate

i am working on some updation in Hibernate application. in which Struts and Spring used. we do entries of .hbm file in configration file(.cfg file). but when using spring with hibernate app we do entries in application context.xml. but i can not find configration entries in entire application. Is there any other class where we configure...

No submit on Spring 3 form when user presses enter or any other key

How to gain function mentioned above? Google is not very helpful with this- ...

which version of Spring + Hibernate + JBoss work

Looking for guidance as to what version of Spring, Hibernate and JBoss work together. I am currently using: <dependencies> <dependency org="javax.servlet" name="jstl" rev="1.1.2" conf="runtime->default"/> <dependency org="org.springframework" name="spring" rev="2.5.6" conf="runtime->default"/> <dependency org="org.springfra...

Annotation endpoint Location for JAX-WS

Hi, does exist a specific annotation to define the address of the endpoint. In fact, I want to remove the attribute address in the SPring file and move the annotation directly in the impl. class. Current: jaxws:endpoint id="dataManagerEndPoint" implementor="#dataManagerService" address="/datamanager/v1.0" @WebService public interf...

STILL: How can I access a Velocity template from a sub-subdirectory with a custom ViewResolver?

I need help creating a custom *ViewResolver * I have a velocity template rendering VXML that is located at /billing/billingQuestionsMenu_pp.vm then, in that template, I am forwarding to: <submit next="#springUrl('/billing/billingQuestions/billingQuestionsMenuOption1.vxml')" /> Now in my Controller, I have a mapped method: @Reques...

Not able to resolve ClassNotFoundException for DispatcherServlet (on Spring)

Hi! here is my web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "> ...

what are @Repository and @Autowired used for. (Spring)

Hi, I am learning java for 3 months and sometimes i can not understand the usage purpose of something. one topic was dependency injection and spring beans i figured out the finally =) now i confused with the two annotations @Autowired and @Repository. First What does Autowiring mean? then Why should i use them and what is the diffe...

How to measure time to execute a query when using SimpleJdbcTemplate

The only solution I can come up with is to write a decorator class that decorates each and every method of SimpleJdbcTemplate, and logs the time taken. Do you have any thing better?? ...

What should i use i if need a custom converter when using @RequestParam ???

I if have a method signature as follows public void deposit(@RequestParam("accountId") Integer accountId, @RequestParam("amount") BigDecimal amount) {...} And because i have a locale specific decimal value which needs to be converted to a BigDecimal, is there some annotation which allows me to set up incoming data...

How iterate over a potentially infinite collection of collections using JSTL

Preface: I am a long-time fan of SO, read stuff here almost everyday -- but this is my first question -- thank you to everyone who has made SO such a fantastic resource! Environment: Spring/JSTL/Java ; the constraints of this project are such that I cannot accept a solution which requires abandoning Spring/Java, though I could probably...

Servlets and backend relationship

Hi, We can say Servlets are back end right? An interviewer once said "Servlets are not back end and for example Spring, EJB do". Is it right? Even spring MVC internally uses servlets to handle the requests right? Thank You. ...

I need to autowire ServletContextResource in class that implements InitializingBean

I need to get ServletContextResource in class that implements InitializingBean, how is that possible? I tried with following, code but it get expcetion for that code. Code: public class InitBean implements InitializingBean { @Autowired private ServletContextResource context; @Override public void afterPropertiesSet() thro...

How can I combine @Aspect with @Controller in Spring 3?

Hello! I'm trying to setup a Spring 3 Web MVC project, using the @Controller, annotation-based approach. package my.package @Controller @RequestMapping("/admin/*") public class AdminMultiActionController { @RequestMapping(value = "admin.htm", method = RequestMethod.GET) public String showAdminSection() { return "admin"; } My di...

Requiring parameters in a SQL where clause?

Imagine you have the following table (note: this is a contrived/simplified example): CREATE TABLE foo ( book_id number, page number, -- [a bunch of other columns describing a single page in a book] ); ALTER TABLE foo ADD (CONSTRAINT foo_pk PRIMARY KEY(book_id, page)); While (book_id, page) pairs are unique, the same page nu...

url link is too long to fit in one line Spring MVC

How to avoid break in long url link sent through Spring MVC web app? It is a redirect url sent to email box in case of reset password request http://man-01668:9090/HDCdemo/demoservice/portal/resetpassword.htm?pfpc=tMgmMyBhpVRi1pZq&amp;redirect_url=http://localhost:8080/HDCdemo/demoservice/portal/myprofile.htm?_flowId=citizenportal/mypro...

Spring transactions & hibernate: lazy initialization

From what I've read so far I had the understanding that using transactions would be the solution to hibernate's lazy loading problems. The session would be available during the whole transaction in the service layer without further adue. So maybe I misconfigured my transaction management? I'm actually a newb when it comes to spring and ...

Spring MVC 3.0 accessing Session Variable

Hi, I have the following problem, I have configured the following class which should be stored in session. <bean id="Users" class="com.doolloop.DlUser" scope="session"> <aop:scoped-proxy/> </bean> Then I in my Dispatcher servlet I would like to access this class user and set @RequestMapping(value="/authenticate.do",method = Reques...

Relationships between Spring, Hibernate, JDBC..

Dear All, I just start reading Sun's JDBC tutorial. I installed MySQL Connector/J and was just skimming through its menu, then came across this statement: "Although JDBC is useful by itself, we would hope that if you are not familiar with JDBC that after reading the first few sections of this manual, that you would avoid using naked JD...

What java web framework is used in the biggest world banks?

Do you have information about what java web framework is mostly used in the biggest world banks as web back-end? ...