Mmm, so there are a milion ways to do this so it works and two ways it doesn't and I happen to have found them... Damn I'm smart! But serious...
What I did learn from this is that the /servlet/* is purely virtual and only makes sure the servlet is being invoked when it finds it in the url, I just didn't get that before. What I don't like now is that you can just browse .../<deploy-location>/resources etc. Is there a way to avoid that in the web.xml? p On Tuesday 11 May 2004 16:31, Henning P. Schmiedehausen wrote: > "Martin Stolz" <[EMAIL PROTECTED]> writes: > >Hi, > > > >i am not shure but you may also map only urls ending in .vm to your > > servlet and bang, you dont need servlet in your url any more... It might > > even be that way you can specify that all urls except .gif, .jpeg et > > cetera will not go through your servlet and all the others will. > > Actually, you can do it even simpler: > > In my applications I use this web.xml: > > <web-app> > <servlet> > <servlet-name>turbine</servlet-name> > <servlet-class>org.apache.turbine.Turbine</servlet-class> > <init-param> > <param-name>properties</param-name> > <!-- This is relative to the docBase --> > <param-value>/WEB-INF/conf/turbine.properties</param-value> > </init-param> > </servlet> > <servlet-mapping> > <servlet-name>turbine</servlet-name> > <url-pattern>/app/*</url-pattern> > </servlet-mapping> > </web-app> > > and now you can use > > http://your.server:port/<deploy-location>/app/turbine > > as the location of the Turbine servlet. > > Regards > Henning > > >Regards, > >martin > >----- Original Message ----- > >From: <[EMAIL PROTECTED]> > >To: "Turbine Users List" <[EMAIL PROTECTED]> > >Sent: Tuesday, May 11, 2004 9:51 AM > >Subject: Re: beginner... problem displaying images > > > >> Hi David, > >> > >> I found it I guess, thanks to you setting me on the right track. > >> I previously had this in my web.xml under WEB-INF > >> ... > >> <servlet-mapping> > >> <servlet-name>test</servlet-name> > >> <url-pattern>/*</url-pattern> > >> </servlet-mapping> > >> ... > >> > >> Then everything worked, except the static stuff didn't get loaded, > > > >probably > > > >> because my servlet can't handle those. When I changed this to: > >> ... > >> <servlet-mapping> > >> <servlet-name>test</servlet-name> > >> <url-pattern>/servlet/*</url-pattern> > >> </servlet-mapping> > >> ... > >> > >> Everything is ok if I do it this way. I'd better read up on tomcat > >> config > > > >I > > > >> guess. Why do you actually need the /servlet there, is it the servlet > >> container specification that dictates it and why does it work at all > >> with other mapping? I will have /servlet in each url now of course, > >> which is a little ugly also. > >> But hey! It works and I have been searching a while on this one. > >> > >> thanks David > >> > >> On Monday 10 May 2004 17:15, David Demner wrote: > >> > Hi Peter, > >> > > >> > Sounds like a tomcat config problem. Do you have any > >> > redirects/rewrites that may prevent the browser from getting to the > >> > image? Is the image > > > >being > > > >> > looked for in the correct place (ie: Is the name of your webapp > >> > 'app')? Can you get anything for a directory other than in > >> > /app/servlet/app (ie create webapps/app/blah.txt and see if you can > >> > access that via http://localhost:8080/app/blah.txt)? > >> > > >> > Did you change the Tomcat server.xml or just the web.xml? Maybe post > > > >your > > > >> > web.xml here...? > >> > > >> > David > >> > > >> > > >> > -----Original Message----- > >> > From: peter snauwaert [mailto:[EMAIL PROTECTED] > >> > Sent: Monday May 10, 2004 1:07 AM > >> > To: Turbine Users List > >> > Subject: Re: beginner... problem displaying images > >> > > >> > > >> > Hi David, thanks for the suggestions. The other post was also coming > > > >from > > > >> > me, > >> > though it took about four days to arrive in the list, don't know why. > >> > > >> > No I don't get the image in my browser, not even if I first log in and > > > >then > > > >> > paste the url in the browser. I do have the impression my css isn't > >> > functional either. I've set my paragraph font to 24px which should be > >> > visible > >> > enough, but it isn't applied. > >> > Another thing I noticed is that my image hasn't got :8080 in the link, > >> > which > >> > > >> > may be due to my tampering with several settings, because I seem to > >> > remember > >> > > >> > it was there previously. > >> > Anyway if I paste the image link in the DefaultTop.vm literally it > >> > still doesn't display. > >> > So I guess I just have found an extra problem: the css isn't applied > >> > either. If I screw up the web.xml so that turbine isn't run and I just > >> > browse the directory structure I can click the image and it gets > > > >displayed. > > > >> > anybody any idea? > >> > > >> > thanks, > >> > peter > >> > > >> > On Saturday 08 May 2004 15:35, David Demner wrote: > >> > > Hi Peter, > >> > > > >> > > Do you get the image when you paste the URL into your browser? Does > > > >your > > > >> > > CSS work properly (this uses a similar URL/retrieval technique)? > >> > > > >> > > Does a missing image icon display or does nothing (maybe you have an > > > >HTML > > > >> > > comment that doesn't end where it should)? > >> > > > >> > > Just a few possibilities. > >> > > > >> > > Good luck, > >> > > > >> > > David > >> > > > >> > > -----Original Message----- > >> > > From: peter snauwaert [mailto:[EMAIL PROTECTED] > >> > > Sent: Friday May 7, 2004 7:56 AM > >> > > To: [EMAIL PROTECTED] > >> > > Subject: beginner... problem displaying images > >> > > > >> > > > >> > > Hi list, > >> > > > >> > > Having a problem with a tdk example. > >> > > The gif that's supposed to show up in the upper right > >> > > corner isn't being displayed... > >> > > This is what's found in the DefaultTop.vm in > >> > > /app/templates/app/navigations dir > >> > > <img src="$ui.image($ui.logo)"> > >> > > When I check my document source it transforms this > >> > > into the correct url for the image, but it isn't being > >> > > displayed. I copied different files, with different > >> > > permissions, different file formats, checked the > >> > > permissions to the path to it, got rid of symbolic > >> > > links, to no avail. > >> > > Tomcat is 5.0.19 / Turbine 2.3.1 / Velocity 1.3.1 > >> > > > >> > > This is what is being logged. > >> > > [DEBUG] ServerData - > >> > > -setScriptName(resources/ui/skins/default/images/logo.gif) > >> > > [DEBUG] BaseURI - -No Response Object! > >> > > [DEBUG] BaseURI - -encodeResponse(): > >> > > http://localhost:8080/app/resources/ui/skins/default/images/logo.gif > >> > > > >> > > Does anyone know what the problem is? > >> > > > >> > > thx, > >> > > peter > >> > > > >> > > > >> > > -------------------------------------------------------------------- > >> > >- To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > > For additional commands, e-mail: > >> > > [EMAIL PROTECTED] > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
