List Info

Thread: How to access files in the root folder




How to access files in the root folder
country flaguser name
United States
2007-07-23 05:55:17
Hi.
I've placed the file robots.txt in the root of my website:
http://programaresociala.
ro
But when I try to get http://program
aresociala.ro/robots.txt i'm redirected
to http://progra
maresociala.ro/robots.txt/ folder and I see the content
of
my blog instead.

Kinda annoyed.
-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11741548
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-23 13:02:03
This is probably a problem with your mapping if you're
mapping * to go
through blojsom servlet. Don't do that. Only
"blog" requests should be
mapped through blojsom servlet.

On 7/23/07 6:55 AM, "Arise" <against_spamzyahoo.com> wrote:

> 
> Hi.
> I've placed the file robots.txt in the root of my
website:
> http://programaresociala.
ro
> But when I try to get http://program
aresociala.ro/robots.txt i'm redirected
> to http://progra
maresociala.ro/robots.txt/ folder and I see the content
of
> my blog instead.
> 
> Kinda annoyed.

-- 
David Czarnecki

http://www.blojsom.com/b
log/ | http://blojsom.sf.net



------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-24 05:42:55
I understand that I'm sending everything to go through the
blojsom servlet,
but I want to keep everything in the root.
I don't want to keep the blog in the /blog folder.

How can I serve individual files like robots.txt then?



David Czarnecki wrote:
> 
> This is probably a problem with your mapping if you're
mapping * to go
> through blojsom servlet. Don't do that. Only
"blog" requests should be
> mapped through blojsom servlet.
> 
> On 7/23/07 6:55 AM, "Arise"
<against_spamzyahoo.com> wrote:
> 
>> 
>> Hi.
>> I've placed the file robots.txt in the root of my
website:
>> http://programaresociala.
ro
>> But when I try to get http://program
aresociala.ro/robots.txt i'm
>> redirected
>> to http://progra
maresociala.ro/robots.txt/ folder and I see the content
>> of
>> my blog instead.
>> 
>> Kinda annoyed.
> 
> -- 
> David Czarnecki
> 
> http://www.blojsom.com/b
log/ | http://blojsom.sf.net
> 
> 
> 
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? 
Stop.
> Now Search log events and configuration files using
AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Blojsom-users mailing list
> Blojsom-userslists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
> 
> 

-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11760481
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-24 12:38:41
Yes, but tomcat, besides being an application server for
serving servlets and
jsp pages can also act like a web server in order to serve
static content.

In the conf folder there is a web.xml file that has a
servlet there:
DefaultServlet. I guess this one is the servlet for serving
static files.

How can I use it for serving my static files before blojsom
servlet?

I managed to get (only one time!) a file: robots.tzt (yes,
tzt, i made a txt
file with that extension) but I guess it happened because I
requested the
file before blojsom servlets were loaded.




David Czarnecki wrote:
> 
> You'll have to find some way of filtering or excluding
files or patterns
> before they get processed by the blojsom servlet.
Again, URL rewrite
> filter
> might help here.
> 
> 
> On 7/24/07 6:42 AM, "Arise"
<against_spamzyahoo.com> wrote:
> 
>> 
>> I understand that I'm sending everything to go
through the blojsom
>> servlet,
>> but I want to keep everything in the root.
>> I don't want to keep the blog in the /blog folder.
>> 
>> How can I serve individual files like robots.txt
then?
>> 
>> 
>> 
>> David Czarnecki wrote:
>>> 
>>> This is probably a problem with your mapping if
you're mapping * to go
>>> through blojsom servlet. Don't do that. Only
"blog" requests should be
>>> mapped through blojsom servlet.
>>> 
>>> On 7/23/07 6:55 AM, "Arise"
<against_spamzyahoo.com> wrote:
>>> 
>>>> 
>>>> Hi.
>>>> I've placed the file robots.txt in the root
of my website:
>>>> http://programaresociala.
ro
>>>> But when I try to get http://program
aresociala.ro/robots.txt i'm
>>>> redirected
>>>> to http://progra
maresociala.ro/robots.txt/ folder and I see the content
>>>> of
>>>> my blog instead.
>>>> 
>>>> Kinda annoyed.
>>> 
>>> -- 
>>> David Czarnecki
>>> 
>>> http://www.blojsom.com/b
log/ | http://blojsom.sf.net
>>> 
>>> 
>>> 
>>>
------------------------------------------------------------
-------------
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find
problems?  Stop.
>>> Now Search log events and configuration files
using AJAX and a browser.
>>> Download your FREE copy of Splunk now >> 
http://get.splunk.com/
>>>
_______________________________________________
>>> Blojsom-users mailing list
>>> Blojsom-userslists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
>>> 
>>> 
> 
> -- 
> David Czarnecki
> 
> http://www.blojsom.com/b
log/ | http://blojsom.sf.net
> 
> 
> 
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? 
Stop.
> Now Search log events and configuration files using
AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Blojsom-users mailing list
> Blojsom-userslists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
> 
> 

-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11768239
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-31 04:37:56
I've changed the BlojsomServlet and now it works.

At the begining of the function:
    protected void service(HttpServletRequest
httpServletRequest,
HttpServletResponse httpServletResponse)

I've added the following lines of code:

  if
(!httpServletRequest.getRequestURI().endsWith("/")
) { //there is no
request for a folder
    String filename =
httpServletRequest.getPathTranslated();   
    if (filename!=null) { //there is a REAL file and we
should serve it
     
getServletContext().getNamedDispatcher("default").
forward(
          httpServletRequest, httpServletResponse);
      return;
    }
  }


I'm opened to any other ideas and sugestions on how to
accomplish the same
task without altering the original blojsom servlet.
-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11921009
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-31 04:39:24
I've changed the BlojsomServlet and now it works.

At the begining of the function:
    protected void service(HttpServletRequest
httpServletRequest,
HttpServletResponse httpServletResponse)

I've added the following lines of code:

  if
(!httpServletRequest.getRequestURI().endsWith("/")
) { //there is no
request for a folder
    String filename =
httpServletRequest.getPathTranslated();   
    if (filename!=null) { //there is a REAL file and we
should serve it, so
forward the request to the DefaultServlet instead of Blojsom
servlet
     
getServletContext().getNamedDispatcher("default").
forward(
          httpServletRequest, httpServletResponse);
      return;
    }
  }


I'm opened to any other ideas and sugestions on how to
accomplish the same
task without altering the original blojsom servlet.
-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11921009
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: How to access files in the root folder
country flaguser name
United States
2007-07-31 04:55:56
I've changed the BlojsomServlet and now it works.

At the begining of the function:
    protected void service(HttpServletRequest
httpServletRequest,
HttpServletResponse httpServletResponse)

I've added the following lines of code:

  if
(!httpServletRequest.getRequestURI().endsWith("/")
) { //there is no
request for a folder
    String filename =
httpServletRequest.getPathTranslated();   
    if (filename!=null) {
      boolean exists = (new File(filename)).exists();
      if (exists){//there is a REAL file and we should serve
it, so forward
the request to the DefaultServlet instead of Blojsom
servlet
       
getServletContext().getNamedDispatcher("default").
forward(
            httpServletRequest, httpServletResponse);
        return;
      }
    }
  }


I'm opened to any other ideas and sugestions on how to
accomplish the same
task without altering the original blojsom servlet.
-- 
View this message in context: http://www.nabble.com/How-t
o-access-files-in-the-root-folder-tf4128936.html#a11921009
Sent from the Blojsom - User mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )