Weird behaviour with @URLMappings

Splash Forums PrettyFaces Users Weird behaviour with @URLMappings

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 4 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19508

    albertoivo
    Participant

    Hello,

    I’m facing a weird behaviour using @URLMapping that I’ve never seen that with xml file.

    Sometimes when I run the URL: localhost:8080/project/aluno it goes to the viewId correctly, and sometimes I get a HTTP 404 (not found).

    What could it be?

    Below is my code:

    @Named("studentBean")
    @URLMappings(mappings = {
    @URLMapping(id = "aluno", pattern = "/aluno", viewId = "/person/student/principal.xhtml"),
    @URLMapping(id = "alunoId", pattern = "/aluno/#{studentBean.personId}", viewId = "/person/student/principal.xhtml")
    })
    public class StudentBean implements Serializable { ... }

    #23420

    So you say if you access /project/aluno in your browser and press F5, it sometimes works and sometimes you get a 404? That’s really strange.

    Could you tell us more about your application structure (which container, JSF implementation & version, etc).

    As I already wrote on your other post, you are missing a scope for your bean. You should add something like @javax.enterprise.context.RequestScoped to it.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.