web.xml/spring url mappings

A

Aljosa Mohorovic

i have this defined in web.xml:
<servlet-mapping>
<servlet-name>admin</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>

and in admin-servlet.xml:
<bean name="/" class="com.[...].pages.Page"></bean>

and when i load http://localhost/admin/ everything works as expected
but when i load http://localhost/admin i get http 404 error. is there
a simple way to fix this little issue?
 
A

Alexandre Jaquet

Aljosa said:
i have this defined in web.xml:
<servlet-mapping>
<servlet-name>admin</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>

and in admin-servlet.xml:
<bean name="/" class="com.[...].pages.Page"></bean>

and when i load http://localhost/admin/ everything works as expected
but when i load http://localhost/admin i get http 404 error. is there
a simple way to fix this little issue?

Hi,

You can fix it by using a welcome file

<welcome-file-list>
<welcome-file>/admin/index.jsp</welcome-file>
</welcome-file-list>

Hope this help.

Regards,

Alexandre
 
A

Aljosa Mohorovic

Hi,
You can fix it by using a welcome file

<welcome-file-list>
<welcome-file>/admin/index.jsp</welcome-file>
</welcome-file-list>

Hope this help.

i tried that, it didn't work. from log:
[org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping] -
<Looking up handler for [/admin]>
[org.springframework.web.servlet.PageNotFound] - <No mapping for [/
admin] in DispatcherServlet with name 'admin'>

any other ideas?
 
A

Alexandre Jaquet

Aljosa said:
i have this defined in web.xml:
<servlet-mapping>
<servlet-name>admin</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>

and in admin-servlet.xml:
<bean name="/" class="com.[...].pages.Page"></bean>

and when i load http://localhost/admin/ everything works as expected
but when i load http://localhost/admin i get http 404 error. is there
a simple way to fix this little issue?


and by updating the bean name <bean name="/admin" ?
 
A

Aljosa Mohorovic

Aljosa said:
i have this defined in web.xml:
<servlet-mapping>
<servlet-name>admin</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>
and in admin-servlet.xml:
<bean name="/" class="com.[...].pages.Page"></bean>
and when i loadhttp://localhost/admin/everything works as expected
but when i loadhttp://localhost/admini get http 404 error. is there
a simple way to fix this little issue?

and by updating the bean name <bean name="/admin" ?

it doesn't work, welcome-file-list has no effect with bean name "/
admin".
any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top