Search Results

Search found 2458 results on 99 pages for 'rafael spring'.

Page 26/99 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • How to add custom SOAP header in Spring WS using Axiom and XmlBeans

    - by java_pill
    I'm using Spring WS 1.5.8, XmlBeans for marshalling/unmarshalling and AxiomSoapMessageFactory. My app. needs a custom SOAP header. The data that needs to be in the SOAP Header is a XmlBean (i.e sessionContext in the code below). How can I construct the SOAP Header with this XmlBeans XmlObject element in it? I've mentioned the code of my WebServiceMessageCallback that I'm using and executing this code results in "'Content is not allowed in prolog.' error. Thanks, public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException { SoapMessage soapMessage = (SoapMessage) message; SoapHeader header = soapMessage.getSoapHeader(); StringSource headerSource = new StringSource(XmlBeanUtils.getValue(sessionContext) ); transform(headerSource, header.getResult()); }

    Read the article

  • flex blazeds spring exception translator

    - by Shah Al
    I am using spring exception translator to wrap java exception into flex exception. eg public void testException()throws Exception{ throw new Exception("my exception"); } But for some reason, I am getting IllegalAccessError. The code sections are entering the testException and the Translator class. Question: why it trying to get log target level ? Can someone help me resolve this please. Below is the lines from the log: MyExceptionTranslatorImpl.translate()class java.lang.IllegalAccessError MyExceptionTranslatorImpl.translate()java.lang.IllegalAccessError: tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException MyExceptionTranslatorImpl.translate()tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException [BlazeDS] tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException [BlazeDS] Serializing AMF/HTTP response

    Read the article

  • Encoding issues with Spring and Freemarker

    - by Cameron
    I'm working on a project using Freemarker and Spring running on Jetty. It will involve displaying characters from many different countries so I'm trying to set the encoding to UTF-8. However, no matter what I do, it remains ISO-8859-1. I tried to create a filter in my web.xml and I've tried putting this response.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=utf-8"); just before rendering the view. But when I load the page and click "View Page Info", the encoding is always ISO-8859-1. I've also tried hitting my app server directly to see if it was being affected by Apache but got the same result. Any help is appreciated.

    Read the article

  • problem with overriding autologin in spring security?

    - by sword101
    greetings everybody iam using spring security 3 remember me service as follows <http> <remember-me/> ....</http> and i want to perform some logic in the autologin so i tried to override the AbstractRememberMeServices as follows: package com.foo; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.RememberMeServices; public abstract class AbstractRememberMeServices implements RememberMeServices{ @Override public Authentication autoLogin(HttpServletRequest arg0, HttpServletResponse arg1) { System.out.println("Auto Login"); return null; } @Override public void loginSuccess(HttpServletRequest arg0, HttpServletResponse arg1, Authentication arg2) { System.out.println("Login Success"); } } but the autologin occurs with no action,the user auto login but the print statement is not printed? what's wrong?

    Read the article

  • Spring MVC and Jetty: Prevent jsessionid from being used in RedirectView on redirect to external sit

    - by Moritz Both
    In Spring MVC 2.5 with Jetty - probably with any servlet container -, I want to redirect to an external site using RedirectView via the magic "redirect:" prefix for the view name in ModelAndView. Unfortunately, RedirectView uses response.encodeURL(), so my (otherwiese wanted) session id is appended to the URL. It is not only a security risk to carry the session id to the external site, the ";jsessionid=gagnbaba" string may also be interpreted as part of the ContextPath/PathInfo on the other site, resulting in a bad URL. Any "springish" options other than implement my own ExternalRedirectView... and also hack the ViewResolver to interpret a "externalRedirect:" prefix? (Requiring cookies is not an option.) Moritz

    Read the article

  • Spring security custom principal bean

    - by wuntee
    I have a web application that is set up to use the default ldap server/authentication manager/authentication provider/user service. I have another DAO that already does majority of the work that those do (besides the authenticating a user) using Spring-LDAP. My problem is that I want the principal to be of my own custom bean class. What is the simplest way to do this? Initially I was thinking to create a custom authentication provider, but since the default one does exactly what I want, there doesnt seem to be a need. I am thinking I just need to override whatever object actually returns the Principal bean. Is this possible, and able to be injected into the security ldap authenticator context?

    Read the article

  • Spring MVC Web PetClinic Tutorial?

    - by wuntee
    Is there a tutorial that goes along with the PetClinic application? I have been trying to find one, but google is not helping me today. Specifically, I dont understand things like: @Autowired - what does that even mean? @RequestMapping(method = RequestMethod.GET) public String setupForm(@RequestParam("petId") int petId, ModelMap model) { Pet pet = this.clinic.loadPet(petId); model.addAttribute("pet", pet); return "petForm"; } How can a request return just a string? Shouldnt it need to return some sort of ModelAndView? Or does the application somehow redirect to whatever is returned? A lot of confusing concepts - if there is a tutorial, or video (like spring-security has) that would be very helpful. Thanks.

    Read the article

  • Setting the default jsp view with spring mvc

    - by Walker
    I want to set one of jsp files in my jsps folder as the default view for the application. Is there any way we can tell in that abc.jsp needs to be default and it can be found in such and such path. Also the url pattern is html so is there a way it can be mapped in Spring MVC. For example - When a user types www.example.com , I want the application to direct to abc.jsp page and also when someone types www.example.com/something, even then application should direct to abc.jsp, but the url pattern shouldnt be compromised. Many Thanks. Nice Day Walker

    Read the article

  • Spring Weblfow 2 - Double Submit

    - by John W.
    Hello All, I am investigating a possible issue with double submits and I am looking at the possibilty of a double submit from a webflow execution. I have read many times that webflow will handle double submits, there are plenty references here. However I then came across I a forum response on the spring source forums contradicting what I read saying, SWF synchronizes on the conversation. Only one request will be processed at a time per conversation. Take note that if you're using snapshots, then it's possible repeatedly clicking on the submit button will generate a second request. I would recommend setting history to invalidate or discard in the transition from your view-state. We do have snapshots enabled but the book notes that using snapshots actually allows to solve the double submits. Does anyone have any insight on this? Thanks.

    Read the article

  • Spring validator default message codes not resolving

    - by Derek Clarkson
    Hi all, I have a custom spring validator which has the following default message: public @interface FieldMatch { String message() default "au.com.xxx.website.FieldMatchValidation"; ... The problem I'm having is that the message code is not being resolved and <form:error...> is simply displaying the code rather than the message (Which is in a properties file which is being used by a ResourceBundleMessageSource). I've also tried this as String message() default "{au.com.xxx.website.FieldMatchValidation}"; Which causes the message source to crash with an exception indicating that it thinks that the "{}" brackets should contain a number because it thinks it's a parameter place holder. I think that the issue is that the message code is not being seen as a message code and therefore not resolved, but I cannot figure out why. Any suggestions?

    Read the article

  • DAO, Spring and Hibernate

    - by EugeneP
    Correct me if anything is wrong. Now when we use Spring DAO for ORM templates, when we use @Transactional attribute, we do not have control over the transaction and/or session when the method is called externally, not within the method. Lazy loading saves resources - less queries to the db, less memory to keep all the collections fetched in the app memory. So, if lazy=false, then everything is fetched, all associated collections, that is not effectively, if there are 10,000 records in a linked set. Now, I have a method in a DAO class that is supposed to return me a User object. It has collections that represent linked tables of the database. I need to get a object by id and then query its collections. Hibernate "failed to lazily initialize a collection" exception occurs when I try to access the linked collection that this DAO method returns. Explain please, what is a workaround here?

    Read the article

  • Spring security accessing principal

    - by wuntee
    When using spring security, specifically with @notation; what is the proper way to access the principal in a Controller? Lets say the following is my controller, but I would like to access the principal in the secure() method somewhere... @Controller public class LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public String login(ModelMap map, @RequestParam(value="fail" , required=false) String fail){ map.addAttribute("title", "Login: AD Credentials"); if(fail != null){ map.addAttribute("error", "Invalid credentials"); } return("login"); } @RequestMapping("/secure") @PreAuthorize("isAuthenticated()") public String secure(ModelMap map, String principal){ System.out.println(principal); return("secure"); } }

    Read the article

  • spring mvc simpleformcontroller - how to stop execution when exception thrown

    - by alan t
    Hi I am using simpleformcontroller and get exception thrown in my OnSubmit method. This does not seem to stop the simpleformcontroler process as it redisplays my form. I can see from log4j output that the exception is getting caught and forwarding to my error page as expected. I can also tell the onSubmit method does not continue after the exception. Which is all good. But i do not see the error page as the simpleformcontroller starts up again and goes through processing for a new form (i can see in log4j ouput Spring log statements 'Displaying New form', 'Creating new command of class ..'. The normal form page is then displayed again. So the problem is that the exception does not seem to terminate the SimpleFormController, it carries on to display the form again. Anyone help? Thanks Alan

    Read the article

  • DataSource for Tomcat web app, Spring and Hibernate

    - by EugeneP
    Web app runs on Tomcat. Datasource is configured with Spring configuration, and is used by Hibernate. If we cannot use JNDI, what would you suggest to use as a DataSource? org.springframework.jdbc.datasource.DriverManagerDataSource will be ok? It's not very good, but sincerely speaking, it can be used on production server, right? Just a bit of headache with too frequent connection reopening. Also, we can use BasicDataSource from Apache. It's much better of course, but here's the question. IF WE DON'T USE JNDI, THEN: If every instance of an app will create its own copy of a DataSource, and every DataSource can have 5 open connections, what do we get? Num_of_running_apps * Num_of_max_active_connections = max active open connection on a DB for this user? Second question: from the perspective of Hibernate, is there any difference about what datasource implementation is used? Will it work with no matter what datasource perfectly and in a stable way?

    Read the article

  • Getting a Spring resource

    - by Javi
    Hello, I'm trying to read a css file with the Resources provided by Spring. My application looks like this: src src/com herer my classes inside packages WebContent WebContent/resources/style/myCSS.css -- the css I want to read WebContent/WEB-INF -- here is my application-context.xml I can get the css and read it by doing something like this: UrlResource file = new UrlResource("http://localhost:8080/myApp/resources/style/myCSS.css"); but it depends on the server and aplication names. I've tried to do it by other implementations of Resource Interface, but the file is not found cause I can't find out how to wite the path. I've tried with this: FileSystemResource file = new FileSystemResource("/WebContent/resources/style/myCSS.css"); I also tried with wildcards, but it doesn't find the file either. ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath*:/WEB-INF/application-context-core.xml"); Resource file = ctx.getResource("file:**/myCSS.css"); How should I write the path to get the css. Thanks.

    Read the article

  • Question about spring transaction propagation

    - by Yousui
    Hi guys, I have a question about spring transaction propagation. If I use @Transactional(propagation = Propagation.REQUIRED) to annotate a method m1. When execution logic enter m1, if there is already a transaction, m1 will use that one. When after m1, what about the transaction? It ends or still open?(if I call m1 in another method, and after the invocation there is still other things to do). In summary, I want to know when exiting an annotated method, the transaction ends or still open? Great thanks.

    Read the article

  • How to manage a large dataset using Spring MySQL and RowCallbackHandler

    - by rmarimon
    I'm trying to go over each row of a table in MySQL using Spring and a JdbcTemplate. If I'm not mistaken this should be as simple as: JdbcTemplate template = new JdbcTemplate(datasource); template.setFetchSize(1); // template.setFetchSize(Integer.MIN_VALUE) does not work either template.query("SELECT * FROM cdr", new RowCallbackHandler() { public void processRow(ResultSet rs) throws SQLException { System.out.println(rs.getString("src")); } }); I get an OutOfMemoryError because it is trying to read the whole thing. Any ideas?

    Read the article

  • Deploying spring message driven pojo on weblogic 8.1

    - by Igman
    Hello, I am trying to deploy a spring message message driven POJO on weblogic 8.1. It is a simple POJO, and it works fine being run outside of an application server, but the messages do not seem to be picked up at all. I have created empty home and remote interfaces, as well as a container bean class that contains an instance of the pojo which it gets from the application context. I then added this container bean class to the ejb-jar.xml as a . I have not been able to get the messages pick up. Does anyone have any suggestions as to what I am doing wrong? Could anyone point me to a tutorial on how to deploy a MDP? Thanks.

    Read the article

  • Spring/Hibernate/Junit example of testing DAO against HSQLDB

    - by Ryan P.
    Hi guys, I'm working on trying to implement a JUnit test to check the functionality of a DAO. (The DAO will create/read a basic object/table relationship in HSQLDB). The trouble I'm having is the persistence of the DAO (for the non-test code) is being completed through an in-house solution using Spring/Hibernate, which eliminates the usual *.hbm.xml templates that most examples I have found contain. Beacuse of this, I'm having some trouble understanding how to setup a JUnit test to implement the DAO to create/read (just very basic funtionality) to an in-memory HSQLDB. I have found a few examples, but the usage of the in-house persistence means I can't extend some of the classes the examples show (I can't seem to get the application-context.xml setup properly). Can anyone suggest any projects/examples I could take a look at (or any documentation) to further my understanding of the best way to implement this test functionality? I feel like this should be really simple, but I keep running into problems implementing the examples I have found. Thanks in advance!

    Read the article

  • Create spring beans, based on a comma-separated list of classes

    - by Jeroen
    Is there a way in Spring to create a collection, or array, of beans, based on a comma-separated list of classes. For example: package mypackage; public class Bla { private Set<MyBean> beans; public void setBeans(Set<MyBean> beans) { this.beans = beans; } } With the application context: <bean id="bla" class="mypackage.Bla"> <property name="beans"> <set> <bean class="mypackage.Bean1, mypackage.Bean2" /> </set> </property> </bean> Preferably the beans are all initialized and wired from the context, leaving the code as simplistic as possible, is this possible?

    Read the article

  • Relative paths in spring classpath resource

    - by Mike Q
    Hi all, I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a local build outside of a jar file. But when I package everything up in a jar then I get an error that it cannot resolve the URL resource. If I change the above to an absolute path (with classpath:) then it works fine. Is there any way to use relative paths with ".." in when the configs are packaged in a jar or am I restricted to descending relative paths and absolute paths only? Thanks.

    Read the article

  • Spring Transaction Manager

    - by cedric
    Hi. I have a j2ee application running on spring framework. I am implementing a transaction manager with AOP. It works fine. When an exception occurs in my method it is detected by my AOP configuration and rolls back the changes in the DB. But the problem is the code where you expect the error should not be surrounded with try-catch. When I suround it with try-catch it won't roll-back. But I need to do some stuffs like logging whenever there are errors and the only place I can think of placing it is in the catch block.

    Read the article

  • Spring: Inject static member (System.in) via constructor

    - by Julian Lettner
    I wrote some sort of console client for a simple application. To be more flexible, I thought it would be nice to only depend on java.io.Input-/OutputStream, instead of accessing System.in/out directly. I renamed the class ConsoleClient to StreamClient, added setters and made sure that the instance fields are used instead of System.in/out. At the moment my client code looks like this: ApplicationContext appCtx = new ClassPathXmlApplicationContext("..."); StreamClient cc = (StreamClient) appCtx.getBean("streamClient"); cc.setInputStream(System.in); cc.setOutputStream(System.out); cc.run(); // start client Question: Is there a way to move lines 3 and 4 into the Spring configuration (preferably constructor injection)? Thanks for your time.

    Read the article

  • spring 3 mvc requestmapping dynamic param problem

    - by Faisal khan
    I have the following code which works fine with http://localhost:8080/HelloWorldSpring3/forms/helloworld but i want to have url have some thing like this http://localhost:8080/HelloWorldSpring3/forms/helloworld/locname_here/locid_here I found that adding this @RequestMapping("/helloworld/**") will work but when i try to access http://localhost:8080/HelloWorldSpring3/forms/helloworld/locname_here/locid_here it is not found. Web.xml entry as follows <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/forms/*</url-pattern> </servlet-mapping> Mapping bean entry @RequestMapping("/helloworld/**") public ModelAndView helloWord(){ String message = "Hello World, Spring 3.0!"; return new ModelAndView("helloworld", "message",message); }

    Read the article

  • Spring - disable bind exceptions (for a particular property)

    - by Walter White
    Hi all, In a web application I'm working on using Spring 2.5.6.SEC01, I essentially have an Integer field that takes a number to determine which page to scroll to. The requirements changed, and we no longer want to display an error message, but simply ignore the user's input if they enter an invalid number, say "adfadf". I was reading that you can do that via: TypeMismatch.property=Some New Error Message However, after having tried that, we are still getting the original error message: java.lang.Integer.TypeMismatch=... I only want to disable this message for that given property. How can I do that? I still want binding to occur automatically, I just don't want to hear about it now. Walter

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >