Search:

Type: Posts; User: SpringOrSummer; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Marten, do you know where that post is?

    Marten, do you know where that post is?
  2. Low level explanation how spring binds controller/method urls and routing

    Is there a low level explanation on how spring goes about mapping the urls that we define using annotations?

    I'm guessing it is something like this, but would be interested if someone can explain...
  3. I did find a post where you were involved, but...

    I did find a post where you were involved, but I'm nto sure if it was 3.1 or not.

    I'll try and find it again.
  4. Creating a Custom handlermapper, What handlermapping does spring mvc use?

    In my spring mvc application, I am using annotations on the controllers.

    What handlermapping implementation will map my urls to controller methods then? (I use requestmapping("/home")

    As a...
  5. Now that worked for the method level, but failed...

    Now that worked for the method level, but failed when I added the annotation at the controller level.

    My code:



    HandlerMethod handlerMethod = (HandlerMethod) handler;

    ...
  6. Marten, So when I add the same annotation on a...

    Marten,

    So when I add the same annotation on a controller method, it doesn't seem to work i.e. authenticationRequiredAnnotation == null (see below)

    Any ideas why this may be?


    ...
  7. Embedded Jetty example with Spring MVC

    Is there an example of spring MVC with an embedded jetty instance?

    I would really appreciate if someone has a working example of how to create a main class with an embedded jetty instance using...
  8. Can I re-use my validations? Do I create a different class per form?

    I have a UserForm.java file, that has:


    public class UserForm {
    @NotNull(message = "Email cannot be empty.")
    @Size(min=3, max=100, message="Email must be between 3 and 100 characters...
  9. Where do add additional logic for validation that makes db calls?

    My create controller method looks like this:


    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public ModelAndView create(@Valid AccountForm accountForm, BindingResult...
  10. Actually I take that back, if any of my form...

    Actually I take that back, if any of my form fields are empty, it crashes before the controller that handles the post can get fired.

    Seems like the validation runs, and fails, and throws the...
  11. Ok it was crashing because in my html I had...

    Ok it was crashing because in my html I had name="name" instead of "accountName".
  12. OK so this is what I have now: ...

    OK so this is what I have now:



    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public ModelAndView create(@Valid @ModelAttribute("accountForm") AccountForm accountForm,...
  13. So would the @ModelAttribute be included with the...

    So would the @ModelAttribute be included with the @Valid attribute?
  14. Calling an action from within an action?

    I have a controller action that works fine.

    I want to create an 'alias' url that will just call my original action.

    How can I do this?


    @RequestMapping("/original/url")
    ...
    ..
  15. During application startup, want to output to logs the values stored in my Config

    I have a custom configuration object that I use in my application, and it is loaded from a yaml file.

    I have overriden the toString for this object and want to output to logs during application...
  16. Thanks for some reason it isn't working, I did...

    Thanks for some reason it isn't working, I did this:


    String configPath = "/Users/me/path/to/config/spring-context.xml";
    ApplicationContext springContext = new...
  17. Loading ApplicationContext from a file that isn't in the class path?

    My spring xml file is in a directory that isn't in the class path.

    The file exists, but when I try and load it spring says the file doesn't exist:


    ApplicationContext context = new...
  18. Forgot to mention, maybe this effects things, but...

    Forgot to mention, maybe this effects things, but I am manually loading the context (since it is a 'main' type application):

    ApplicationContext springContext = new...
  19. How to get autowiring in a console application

    For some reason when I moved some of my code over to a 'main' console type application, the autowiring isn't working.

    Before the code was in a MVC application and I had:

    ...
  20. Marten, Thanks that worked, I actually didn't...

    Marten,

    Thanks that worked, I actually didn't have any annotations on my annotation! (and it wasn't working)

    I just added the Retention and Target and now it works.

    I'm guessing TYPE is at...
  21. Ok I am getting access to the handlermethod...

    Ok I am getting access to the handlermethod (thanks for that link!), but having an issue with the annotation, it is always null for some reason.

    First time created an annotation so that might be...
  22. Marten, Yes that is what I am currently doing,...

    Marten,

    Yes that is what I am currently doing, but not in a programatic way per say.

    Currently I am looking at the url, for example, if my controller is ProductController like:

    ...
  23. Creating a controller level annotation that will check request attributes for objects

    Is it possible to create a controller level annotation that will check if there are specific objects in the request Attributes collection?

    If not, I want to redirect to the signin page.

    I...
  24. Is it possible to add an object to all my controller's ModelAndView?

    I create an object in an interceptor and add it to the request attributes collection.

    I need access to this object in my controller and view, currently in each and every controller action I am...
  25. Yes pretty much. So looking at the quickstart,...

    Yes pretty much.

    So looking at the quickstart, you have to create a @Configuration (which is the programatic way of wiring up beans as oppose to the xml way). So I'll look into that to see how...
Results 1 to 25 of 48
Page 1 of 2 1 2