I need to develop a very thin shim for hadoop to be used together with Rails/Sinatra application. I'm a .Net developer and have a lot experience with Ruby. So what is the best framework to choose giving the fact it is needed for a very small project and it should provide RESTful web services.
I looked at Grails and it seems to be very r...
I'm a little confused as to how the IOC works in spring.
Say I have a service class called UserServiceImpl that implements UserService interface.
How would this be auto-wired?
And in my Controllers action, how would I instantiate an instance of this service?
Would I just do:
UserService userService = new UserServiceImpl();
...
I have a Java class (Entity) with a set of named queries. When the Spring tries to inject the related bean, it is not finding one of the queries.
As example:
@NamedQueries({
@NamedQuery(name = "Query1", query = "..."),
@NamedQuery(name = "Query2", query = "..."),
@NamedQuery(name = "Query3", query = "..."),
...
I want to make all beans request scoped by default, however the Spring documentation says that the default scope is Singleton. (sections 3.4.1 and 3.4.2 http://static.springsource.org/spring/docs/2.5.x/reference/beans.html)
I want to declare the default scope to be request scoped.
This is the closest thing I have found so far -- it's ...
Little confused, the basic spring mvc app has this:
app-config.xml
<context:component-scan base-package="org.springframework.samples.mvc.basic" />
and the mvc-config.xml has:
<!-- Configures the @Controller programming model -->
<mvc:annotation-driven />
Do you really need both?
for component-scan, does this mean if I don't p...
In a .jsp I would use:
<fmt:message key="welcome.title"/>
to display a message from my messages.properties file.
How would I do this with freemarker ?
...
hi all . I'm new to spring, currently i use the request scope and get the following exceptions:
javax.el.PropertyNotFoundException: /login/login.xhtml @11,86 action="#{loginViListWeb.nextPage}": Target Unreachable, identifier 'loginViListWeb' resolved to null
the part of the .xhtml is:
<h:outputText value="#{loginViListWeb.empName}"/...
My website has a consistant header and footer that I want on all pages.
What is the best way to do this?
The header will have some dynamic data also, based on the current view.
P.S Does freemarker have any sort of master page functionality? Where I can create a base template, then have other templates build upon the base?
Basically ...
I'm using Spring Test and JUnit to run DAO integration tests. The test class is annotated as follows:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration( { "/testPersist-applicationContext.xml" })
@Transactional
I use the @BeforeTransaction annotation on a method to insert some test data -- that I would expect to be there ...
I have a wicket page , which contains two Spring-managed beans , one is DAO , another is Service Object :
public class MergeAccountsPage extends WebPage
{
@SpringBean
private MergeEmailDao mergeEmailDao;
@SpringBean
private MergingService mergingService;
}
The MergingService's implementation's methods are mostly annotated wit...
I am setting up a simple RESTful controller for a Todo resource with an XML representation. It all works great - until I try to redirect. For example, when I POST a new Todo and attempt to redirect to its new URL (for example /todos/5, I get the following error:
Error 500 Unable to locate object to be marshalled in model: {}
I do know...
In my Spring MVC based web-app, I'm manually creating an Errors/BindingResult object after manually validating one of my domain objects. I can add my domain object into the Model by doing the obvious:
model.addAttribute("myObject", myObject);
After I do validation and have created an Errors/BindingResult object, under which key should...
Hi,
Im doing a JMS project.
can anybody point out a reference on running ActiveMQ(JMS) on two different pc using eclipse on both pc?
tnx
-jaded
...
It’s a general consensus that Singleton is bad for unit-testing.
But what about having an IoC container like the Spring framework to control your beans which are singletons by default? Is using those beans in your classes also considered bad for unit testing the same way singleton is?
...
I'm trying to write a test that isolates the failure to load a property because no Session exists.
The following path fails
ERROR [http-8081-14] LazyInitializationException.setSessionAttribute(223) | could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hib...
I am getting this exception in a controller of a web application based on spring framework using hibernate. I have tried many ways to counter this but could not resolve it.
In the controller's method, handleRequestInternal, there are calls made to the database mainly for 'read', unless its a submit action.
I have been using, Spring's S...
I have a maven project under eclipse with m2eclipse.
WHen running integration tests the tests fail with the mention that the spring configuration files cannot be found on the classpath, and I get a similar error from log4j.
I was under the impression that m2eclipse would add the resources directories to the classpath but apparently no...
How is this done? I have a view which in certain conditions I need to display using HTTP and in other cases HTTPS. The controller is using SimpleFormController.
...
I am using Spring with WebSphere 6.1 and today I started to get NET_BIND errors stating that port 1099 (port that Spring is using) is already in use and that Spring cannot use it. I've been using that port for a long time and ran netat to make sure that 1099 wasn't listed (which it wasn't). I also looked at the ports configured for my ...
I am wiring my UserService type classes using spring's IOC.
But what about my User class?
I have a interface User, then a UserImpl class.
In my controller action's do I just do:
User u = new UserImpl();
Or would it sometimes make sense to use IOC for this also?
Sometimes I use a different constructor also when instantiating a cla...