Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

localhost:8080 --> mydomain.com

 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see my following post.
[ January 24, 2008: Message edited by: deb platt ]
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to figure out how you go from being http://localhost:8080/myContext/somefile to being http://www.mydomain.com/somefile. I'm using Apache tomcat, and I figure there must be some way of configuring tomcat to do this.
[ January 24, 2008: Message edited by: deb platt ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deb platt:
Please excuse the wording of my original post. I was in the middle of editing it, and it got posted by accident

Click on the notepad and pencil icon to revise a post with problems.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want your app to be the root context in your container.

In Tomcat, the easiest way to do that is to rename your app's directory to "ROOT". You might want to back up the ROOT app that ships with Tomcat so you can move it back in for debugging, if necessary.
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for suggesting that I install my web application as ROOT. After doing this, everything has been working as I had hoped, except for one thing. When I enter my domain, an authentication form appears, as expected. I enter my username and password, and intead of being directed to my home page, the follow-up is a 404 message saying /favicon.ico is not available. I am wondering if this is something left over from the default ROOT directory. There is no reference to /favicon.ico within my web app.

After getting this 404 message, if I explicitly enter my home page's URL, everything from then on seems to be working well.

Deb
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried copying the favicon.ico from the original root into my root, and now after being authenticated, a web page displaying favicon.ico appears in my firefox browser instead of my home page.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your security-constraint entry?
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<security-constraint>
<web-resource-collection>
<web-resource-name>testsecurity</web-resource-name>
<url-pattern>/*</url-pattern>
<url-pattern>*.class</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Admin</role-name>
</auth-constraint>
</security-constraint>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder if is causing the request for favicon.ico (something that I think browser's do automatically) to be trapped as your last request for a resource and trying to force that request through security.

Do you really need to check everything or could you use a less restrictive url-pattern (or series of url patterns)?

If not, I wonder if adding an explicit link to an icon will eliminate the automatic request by the browser...
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried adding the <link ...> element, but that didn't help. As soon as I was authenticated, I was presented with the favicon.ico as my first page.

I removed the <link ...> element and altered my security constraint to match the following url patterns:
<url-pattern>*.html</url-pattern>
<url-pattern>*.class</url-pattern>
<url-pattern>*.jsp</url-pattern>
Once I did that, my problem with the favicon.ico went away, and the icon even appeared in the address field of my browser as it should.

I had set up my security constraint to be something like this originally when the site was being accessed as http://localhost:8080/myContext However I encountered a problem with my authentication form, which was a .jsp file. If I entered the URL as http://localhost:8080/myContext, I was challenged to authenticate, and everything worked fine. However, if I entered the URL as http://localhost:8080/myContext/ with a closing slash, I would authenticate, and then I would be presented the login.jsp form again. And if I filled it out a second time, I got a 404 error saying j_security_check was not available. That was worrying me, so I fiddled with the serurity-constraint element some more. But regardless, I always had the same difficulty if the URL was entered with a closing slash.

Now that I'm trying out the web app as ROOT, it doesn't seem to matter whether there is a trailing slash in the address, which is a relief.

Thank you for your help.

Deb
[ January 24, 2008: Message edited by: deb platt ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic