Search Results

Search found 2367 results on 95 pages for 'spring'.

Page 4/95 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Request size limitation when using MultipartHttpServletRequest of Spring 3.0

    - by Spiderman
    I'd like to know what is the size limitation if I upload list of files in one client's form submition using HTTP multipart content type. On the server side I am using Spring's MultipartHttpServletRequest to handle the request. mM questions: Is there should be different file size limitation and total request size limitation or file size is the only limitation and the request is capable of uploading 100s of files as lonng as they are not too large. Doest the Spring request wrapper read the complete request and store it in the JAVA heap memory or it store temporaray files of it to be able to use big quota. Is the use of reading the httpservlet request in streaming would change the size limitation than using complete http request read at-once by the application server. What is the bottleneck of this process - Java heap size, the quota of the filesystem on which my web-server runs, the maximum allowed BLOB size that the DataBase in which I am gonna save the file alows? or Spring internal limitations? Related threads that still don't have exact answer to this: does-spring-framework-support-streaming-mode-in-mutlipart-requests is-there-a-way-to-get-raw-http-request-stream-from-java-servlet-handler how-to- drop-body-of-a-request-after-checking-headers-in-servlet apache-commons-fileupload-throws-malformedstreamexception

    Read the article

  • Spring Security ACL: NotFoundException from JDBCMutableAclService.createAcl

    - by user340202
    Hello, I've been working on this task for too long to abandon the idea of using Spring Security to achieve it, but I wish that the community will provide with some support that will help reduce the regret that I have for choosing Spring Security. Enough ranting and now let's get to the point. I'm trying to create an ACL by using JDBCMutableAclService.createAcl as follows: [code] public void addPermission(IWFArtifact securedObject, Sid recipient, Permission permission, Class clazz) { ObjectIdentity oid = new ObjectIdentityImpl(clazz.getCanonicalName(), securedObject.getId()); this.addPermission(oid, recipient, permission); } @Override @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_UNCOMMITTED, readOnly = false) public void addPermission(ObjectIdentity oid, Sid recipient, Permission permission) { SpringSecurityUtils.assureThreadLocalAuthSet(); MutableAcl acl; try { acl = this.mutableAclService.createAcl(oid); } catch (AlreadyExistsException e) { acl = (MutableAcl) this.mutableAclService.readAclById(oid); } // try { // acl = (MutableAcl) this.mutableAclService.readAclById(oid); // } catch (NotFoundException nfe) { // acl = this.mutableAclService.createAcl(oid); // } acl.insertAce(acl.getEntries().length, permission, recipient, true); this.mutableAclService.updateAcl(acl); } [/code] The call throws a NotFoundException from the line: [code] // Retrieve the ACL via superclass (ensures cache registration, proper retrieval etc) Acl acl = readAclById(objectIdentity); [/code] I believe this is caused by something related to Transactional, and that's why I have tested with many TransactionDefinition attributes. I have also doubted the annotation and tried with declarative transaction definition, but still with no luck. One important point is that I have used the statement used to insert the oid in the database earlier in the method directly on the database and it worked, and also threw a unique constraint exception at me when it tried to insert it in the method. I'm using Spring Security 2.0.8 and IceFaces 1.8 (which doesn't support spring 3.0 but definetely supprorts 2.0.x, specially when I keep caling SpringSecurityUtils.assureThreadLocalAuthSet()). My AppServer is Tomcat 6.0, and my DB Server is MySQL 6.0 I wish to get back a reply soon because I need to get this task off my way

    Read the article

  • Custom bean instantiation logic in Spring MVC

    - by Michal Bachman
    I have a Spring MVC application trying to use a rich domain model, with the following mapping in the Controller class: @RequestMapping(value = "/entity", method = RequestMethod.POST) public String create(@Valid Entity entity, BindingResult result, ModelMap modelMap) { if (entity== null) throw new IllegalArgumentException("An entity is required"); if (result.hasErrors()) { modelMap.addAttribute("entity", entity); return "entity/create"; } entity.persist(); return "redirect:/entity/" + entity.getId(); } Before this method gets executed, Spring uses BeanUtils to instantiate a new Entity and populate its fields. It uses this: ... ReflectionUtils.makeAccessible(ctor); return ctor.newInstance(args); Here's the problem: My entities are Spring managed beans. The reason for this is to inject DAOs on them. Instead of calling new, I use EntityFactory.createEntity(). When they're retrieved from the database, I have an interceptor that overrides the public Object instantiate(String entityName, EntityMode entityMode, Serializable id) method and hooks the factories into that. So the last piece of the puzzle missing here is how to force Spring to use the factory rather than its own BeanUtils reflective approach? Any suggestions for a clean solution? Thanks very much in advance.

    Read the article

  • New to Java and Spring. What are some good design principles for an inexperienced java developer like me?

    - by Imtiaz Ahmad
    I am learning Java and have written a few small useful programs. I am new to spring but have managed to understand the concept of dependency injection for decoupling. I'm trying to applying that in my development work in an enterprise setting. What are the 3 most important design patterns I should master (not for interview purposes but ones that I will use every day in as a good java developer)? Also what are some good java design considerations and practices in coding specifically in Java? My goal is write good decoupled and coherent programs that are easy to maintain that don't make me standout as a java rookie. Stuff like not beginning my package names with com. have already made me precariously visible in my team. But they know I have 2 years of coding experience and its not in java.

    Read the article

  • Spring-json problem in Liferay with Spring 2.5

    - by Jesus Benito
    Hi all, I am trying to use the library spring-json.1.3.1 in a project that has been done with Liferay 5.1.2 which includes Spring 2.5. Following the project website instructions, I managed to make the request hit in my controller, but at the moment of returning the json object back through the modelAndView object it fails with the following error: java.lang.IllegalArgumentException at com.liferay.portlet.MimeResponseImpl.setContentType(MimeResponseImpl.java:162) I have checked Liferays source code, and it checks that contentType that its being set is in a harcoded list,if it not it will throw a IllegalArgumentException that it is exactly what os happening. This is my view resolver code: <bean id="xmlFileViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver"> /WEB-INF/context/views.xml 1 My views.xml code: <beans> <bean name="jsonView" class="org.springframework.web.servlet.view.json.JsonView"/> And my controller: @SuppressWarnings("unchecked") @Override public ModelAndView handleRenderRequest(RenderRequest arg0, RenderResponse arg1) throws Exception { Map model = new HashMap(); model.put("firstname", "Peter"); model.put("secondname", "Schmitt"); return new ModelAndView("jsonView", model); } Any ideas?

    Read the article

  • Ruby on Rails vs Grails vs. Spring ROO vs. Spring App

    - by lizdev
    Hi, I'm planning on writing a simple web application that will be used by lots of users (as complicated as a simple bookmarking app) and I'm trying to decide which framework/language to use. I'm very experienced with Spring/Hibernate and Java in general but new to both Grails and RoR (and Spring ROO). The only reason I'm considering RoR is because Java hosting is MUCH more expensive than RoR hosting (which is supported by almost any hosting vendor for 5$ per month). Assuming the price wasn't an issue, which one of the frameworks/languages mentioned above would you recommend for a Java developer (who knows how to configure Spring/Hibernate etc.)? I'm afraid that by using RoR I won't be able to easily support many users who are using the website at the same time. thanks

    Read the article

  • Spring Web Service Client Tutorial or Example Required

    - by Nirmal
    Hello All... I need to jump into the Spring Web Service Project, in that I required to implement the Spring Web Service's Client Only.. So, I have already gone through with Spring's Client Reference Document. So, I got the idea of required classes for the implementation of Client. But my problem is like I have done some googling, but didn't get any proper example of both Client and Server from that I can implement one sample for my client. So, if anybody gives me some link or tutorial for proper example from that I can learn my client side implementation would be greatly appreciated. Thanks in advance...

    Read the article

  • PHP Programmer wanting to learn Spring

    - by grokker
    I'm a PHP programmer and I want to try creating a webapp using the Spring framework. The problem is I'm clueless and I don't know where to start. What tutorials/books/websites do you guys suggest that I should learn from? What's IoC? Do I use it alongside MVC? What components of the Spring framework should I use? How do I know what to use? Are there webapps created with Spring that I could study from? Thank you so much in advance! P.S. I've used Struts (1) about a year ago.

    Read the article

  • Tomcat not showing Spring Context initialization errors when running from Eclipse WTP

    - by SourceRebels
    Hi all, Im working with Eclipse Galileo (WTP), Spring 2.5.6-SEC01 and Apache Tomcat 5.5.28. When I run my application from Eclipse, I'm able to see Tomcat standard output and error from the console view. When there is a Spring initialization error (ex: malformed spring XML) I'm not able to see the error message or the stacktrace at the Console view. Anyone found before a problem like this? how you solve it? Thanks in advance, I'm getting mad :-) Edited: I'm seeing all Tomcat startup messages and my System.out.println and System.err.println messages in Eclipse Console. I also try to pass this two system properties to my Tomcat Server: -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" -Djava.util.logging.config.file="C:\apache-tomcat-5.5.28\conf\logging.properties"

    Read the article

  • Spring 3, Java EE 6

    - by arg20
    I'm learning Java EE 6. I've seen how much progress it has achieved in this release of the umbrella specification. EJBs 3.1 are far easier and more lightweight than previous versions, and CDI is amazing. I'm not familiar with Spring, but I often read that it offered some neat features that the Java EE stack didn't. Yet I also read now that JEE has caught up, and can now fully compete with Spring. I know that choosing from both depends on many factors, but if we only focus on features, say the latest trends etc. Which one has the leading edge?. Can Spring 3 offer some assets The JAVA EE 6 stack can't? Also, what about Seam framework? From what I read it's like java ee 6 but with some additions?

    Read the article

  • Spring MVC application - URL gives No file found (404)

    - by user1700184
    I created a Spring-MVC project. web.xml: <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>/soundmails</url-pattern> </servlet-mapping> mvc-dispatcher-servlet.xml <?xml version="1.0"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <mvc:annotation-driven /> <context:component-scan base-package="somepkg.controllers" /> <bean id="multipartResolver" class="org.gmr.web.multipart.GMultipartResolver"> <property name="maxUploadSize" value="1048576" /> </bean> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <!-- property name="location"> <value>/WEB-INF/social.properties</value> </property--> </bean> <bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="jacksonMessageConverter"/> </list> </property> </bean> </beans> The controller has this code: ProjectController.java @Controller @RequestMapping("/soundmails") public class FileUploadController { @RequestMapping(value="/test", method=RequestMethod.GET) public @ResponseBody String test() { System.out.println("Hai"); return "Hai"; } } I am using Google App Engine in my local machine to test this. I am getting these in my log: [INFO] Oct 24, 2013 1:54:18 AM com.google.appengine.tools.development.LocalResourceFileServlet doGet [INFO] WARNING: No file found for: /soundmails/test I tried /soundmails/soundmails/test as well. That is also giving the same error. I am using Spring 3.1.0.RELEASE Can someone help me figure out what I am missing - /soundmails/test is giving 404 error. Edit I am unable to enable DEBUG logs for this. For some reason, it is not taking log level configured in logging.properties But I observed something interesting: 1) If I map the request to empty string (value = "") @RequestMapping(value="", method=RequestMethod.GET) public @ResponseBody String test() { System.out.println("Hai"); return "Hai"; } Then, when I try to access 127.0.0.1/soundmails, it works fine (returns string "Hai"). 2) When I have value="/test" @RequestMapping(value="/test", method=RequestMethod.GET) public @ResponseBody String test() { System.out.println("Hai"); return "Hai"; } and I try to access 127.0.0.1/soundmails/test, it is giving HTTP 404. This is weird.

    Read the article

  • Spring rejecting bean name, no URL paths specified

    - by richever
    I am trying to register an interceptor using a annotation-driven controller configuration. As far as I can tell, I've done everything correctly but when I try testing the interceptor nothing happens. After looking in the logs I found the following: 2010-04-04 20:06:18,231 DEBUG [main] support.AbstractAutowireCapableBeanFactory (AbstractAutowireCapableBeanFactory.java:452) - Finished creating instance of bean 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' 2010-04-04 20:06:18,515 DEBUG [main] handler.AbstractDetectingUrlHandlerMapping (AbstractDetectingUrlHandlerMapping.java:86) - Rejected bean name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': no URL paths identified 2010-04-04 20:06:19,109 DEBUG [main] support.AbstractBeanFactory (AbstractBeanFactory.java:241) - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' Look at the second line of this log snippet. Is Spring rejecting the DefaultAnnotationHandlerMapping bean? And if so could this be the problem with my interceptor not working? Here is my application context: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd" default-autowire="byName"> <!-- Configures the @Controller programming model --> <mvc:annotation-driven /> <!-- Scan for annotations... --> <context:component-scan base-package=" com.splash.web.controller, com.splash.web.service, com.splash.web.authentication"/> <bean id="authorizedUserInterceptor" class="com.splash.web.handler.AuthorizedUserInterceptor"/> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="interceptors"> <list> <ref bean="authorizedUserInterceptor"/> </list> </property> </bean> Here is my interceptor: package com.splash.web.handler; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; public class AuthorizedUserInterceptor extends HandlerInterceptorAdapter { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { log.debug(">>> Operation intercepted..."); return true; } } Does anyone see anything wrong with this? What does the error I mentioned above actually mean and could it have any bearing on the interceptor not being called? Thanks!

    Read the article

  • Spring Security - Persistent Remember Me Issue

    - by Taylor L
    I've been trying to track down why Spring Security isn't creating the Spring Security remember me cookie (SPRING_SECURITY_REMEMBER_ME_COOKIE). At first glance, the logs make it seem like the login is failing, but the login is actually successful in the sense that if I navigate to a page that requires authentication I am not redirected back to the login page. However, the logs appear to be saying the login credentials are invalid. I'm using Spring 3.0.1, Spring Security 3.0.1, and Google App Engine 1.3.1. Any ideas as to what is going on? Mar 16, 2010 10:05:56 AM org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices onLoginSuccess FINE: Creating new persistent login for user [email protected] Mar 16, 2010 10:10:07 AM org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices loginFail FINE: Interactive login attempt was unsuccessful. Mar 16, 2010 10:10:07 AM org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices cancelCookie FINE: Cancelling cookie Below is the relevant portion of the applicationContext-security.xml. <http auto-config="false"> <intercept-url pattern="/css/**" filters="none" /> <intercept-url pattern="/img/**" filters="none" /> <intercept-url pattern="/js/**" filters="none" /> <intercept-url pattern="/app/admin/**" filters="none" /> <intercept-url pattern="/app/login/**" filters="none" /> <intercept-url pattern="/app/register/**" filters="none" /> <intercept-url pattern="/app/error/**" filters="none" /> <intercept-url pattern="/" filters="none" /> <intercept-url pattern="/**" access="ROLE_USER" /> <logout logout-success-url="/" /> <form-login login-page="/app/login" default-target-url="/" authentication-failure-url="/app/login?login_error=1" /> <session-management invalid-session-url="/app/login" /> <remember-me services-ref="rememberMeServices" key="myKey" /> </http> <authentication-manager alias="authenticationManager"> <authentication-provider user-service-ref="userDetailsService"> <password-encoder hash="sha-256" base64="true"> <salt-source user-property="username" /> </password-encoder> </authentication-provider> </authentication-manager> <beans:bean id="userDetailsService" class="com.my.service.auth.UserDetailsServiceImpl" /> <beans:bean id="rememberMeServices" class="org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices"> <beans:property name="userDetailsService" ref="userDetailsService" /> <beans:property name="tokenRepository" ref="persistentTokenRepository" /> <beans:property name="key" value="myKey" /> </beans:bean> <beans:bean id="persistentTokenRepository" class="com.my.service.auth.PersistentTokenRepositoryImpl" />

    Read the article

  • spring MVC sample web app

    - by Don
    Hi, I'm looking for an example Spring MVC 2.5 web app that I can easily: Setup as a project in Eclipse Deploy to a local app server (using Ant/Maven) There are a couple of example applications included with the Spring distribution ('petclinic' and 'jpetstore'), but they don't provide any Eclipse project files (or a way to generate them). They also seem a bit complicated for my needs, e.g. require a local database to be setup. Thanks, Don

    Read the article

  • spring roo vs appfuse generate service /dao layer

    - by cometta
    I am looking for feedback from experienced users on spring roo and appfuse. Which do you think does a better job reverse engineering database tables and generating a service layer, dao layer, and jpa entities? If I am not mistaken, spring roo currently cannot reverse engineer a database.

    Read the article

  • Vaadin and Spring MVC Integration

    - by dakull
    I'm thinking about the possibility of using Spring MVC with Vaadin Framework. Are there any documented ways of making them play nicely together ? Also is it a good idea to use them together ? relating to performance; I'm going to run the app on a dedicated server. To make my question a bit more clear, how can i return a modelandview from a Spring MVC Controller that wll render using Vaadin and can access all the model data.

    Read the article

  • Spring ROO Serverside validation doesn't work

    - by Hussain
    I have created a User domain with not null fields. If i remove following javascript validation on submit. Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'})); Server side validation for notNull attribute doesn't work. On save user is created without validation error. Am I missing something over here ??

    Read the article

  • What exactly is Spring for?

    - by Maksim
    I hear a lot about spring, people are saying all over the web that Spring is good framework for web development. But what exactly is it for? How can I use it for my Web-Java application any examples.

    Read the article

  • Spring integration with RabbitMQ

    - by Albert
    We have build a solution based on file based delivery using Spring-Integration. This works fine but we need to process many files. We are happy with Spring Integration but we want to scale up. For this we'd like to use a messaging system like Rabbit MQ(or other solutions). Does anybody have experience with this, what's needed to get this working?

    Read the article

  • spring roo backup command lost my files

    - by Moddy
    I generated spring roo project and modifies .jspx files to my styles. Unfortunately, when i used the backup command, spring roo was auto-generated files to the original one. Thus, my .jspx files are noy my styles. How should i do to recovery my files back from this command.

    Read the article

  • Spring scheduled tasks

    - by stackuser
    I'm trying to use spring scheduled tasks for my scheduled jobs, I have one scheduler configured for multiple tasks executors as below <task:scheduled-tasks scheduler="ABCTaskScheduler"> <task:scheduled ref="ABCTaskExecutor" method="execute" cron="some_expression_1" /> <task:scheduled ref="DEFTaskExecutor" method="execute" cron="some_expression_1" /> </task:scheduled-tasks> My question in how can I make the task executor list dynamic, so that I do not have to change my spring config each time I have to add a new task executor.

    Read the article

  • Spring MVC, REST, and HATEOAS

    - by SingleShot
    I'm struggling with the correct way to implement Spring MVC 3.x RESTful services with HATEOAS. Consider the following constraints: I don't want my domain entities polluted with web/rest constructs. I don't want my controllers polluted with view constructs. I want to support multiple views. Currently I have a nicely put together MVC app without HATEOAS. Domain entities are pure POJOs without any view or web/rest concepts embedded. For example: class User { public String getName() {...} public String setName(String name) {...} ... } My controllers are also simple. They provide routing and status, and delegate to Spring's view resolution framework. Note my application supports JSON, XML, and HTML, yet no domain entities or controllers have embedded view information: @Controller @RequestMapping("/users") class UserController { @RequestMapping public ModelAndView getAllUsers() { List<User> users = userRepository.findAll(); return new ModelAndView("users/index", "users", users); } @RequestMapping("/{id}") public ModelAndView getUser(@PathVariable Long id) { User user = userRepository.findById(id); return new ModelAndView("users/show", "user", user); } } So, now my issue - I'm not sure of a clean way to support HATEOAS. Here's an example. Let's say when the client asks for a User in JSON format, it comes out like this: { firstName: "John", lastName: "Smith" } Let's also say that when I support HATEOAS, I want the JSON to contain a simple "self" link that the client can then use to refresh the object, delete it, or something else. It might also have a "friends" link indicating how to get the user's list of friends: { firstName: "John", lastName: "Smith", links: [ { rel: "self", ref: "http://myserver/users/1" }, { rel: "friends", ref: "http://myserver/users/1/friends" } ] } Somehow I want to attach links to my object. I feel the right place to do this is in the controller layer as the controllers all know the correct URLs. Additionally, since I support multiple views, I feel like the right thing to do is somehow decorate my domain entities in the controller before they are converted to JSON/XML/whatever in Spring's view resolution framework. One way to do this might be to wrap the POJO in question with a generic Resource class that contains a list of links. Some view tweaking would be required to crunch it into the format I want, but its doable. Unfortunately nested resources could not be wrapped in this way. Other things that come to mind include adding links to the ModelAndView, and then customizing each of Spring's out-of-the-box view resolvers to stuff links into the generated JSON/XML/etc. What I don't want is to be constantly hand-crafting JSON/XML/etc. to accommodate various links as they come and go during the course of development. Thoughts?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >