1

Can't for the life of me figure this out. I deploy an application to glassfish 3.1.2.

I put a test file in the application's folder at the same level as WEB-INF called test.html

Now when I access the file like this: http://myserver/application/test.html It is served out fine as I would expect.

The problem is when the request has parameters attached,i.e.: http://myserver/application/test.html?foo=bar Glassfish returns 404 because it's looking for a file called test.html?foo=bar

How do I get glassfish to ignore parameters and serve the file requested?

mwrf
  • 3,599
  • 1
  • 14
  • 10
  • I am quite sure that this is not Glassfish's fault. That is no valid URL. The host name is missing and you have a triple /. – Matt Handy Mar 14 '12 at 12:31
  • That's just the stackoverflow editor adding the extra slashes, I've removed them now. – mwrf Mar 14 '12 at 12:36
  • I just had a go at replicating the situation that you have described... but I was not able to run into the same problem. You may want to open an NB issue: http://netbeans.org/community/issues.html. SO questions and comments aren't a very good place to isolate bugs. – vkraemer Mar 15 '12 at 02:47

1 Answers1

0

It's nothing to do with Netbeans. I've workaround it by making the html file a servlet:

<servlet>
<servlet-name>openid</servlet-name>
<jsp-file>/test.html</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>openid</servlet-name>
<url-pattern>/test.html</url-pattern>
</servlet-mapping>

So now, test.html?foo=bar is served out as expected. It must be that glassfish expects anything that come in with parameters to be a servlet/jsp whatever.

mwrf
  • 3,599
  • 1
  • 14
  • 10