tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blaxton <blaxx...@yahoo.com>
Subject Re: MVC or Model2 with Tomcat
Date Thu, 08 Dec 2011 10:51:44 GMT
=0A=0A=0A=0A________________________________=0A From: Pid * <pid@pidster.co=
m>=0ATo: Tomcat Users List <users@tomcat.apache.org> =0ASent: Thursday, Dec=
ember 8, 2011 12:25:35 PM=0ASubject: Re: MVC or Model2 with Tomcat=0A =0AOn=
 8 Dec 2011, at 06:08, Blaxton <blaxxton@yahoo.com> wrote:=0A=0A>=0A>=0A>=
=0A>=0A> ________________________________=0A> From: Blaxton <blaxxton@yahoo=
.com>=0A> To: Tomcat Users List <users@tomcat.apache.org>=0A> Sent: Tuesday=
, December 6, 2011 9:19:00 PM=0A> Subject: Re: MVC or Model2 with Tomcat=0A=
>=0A>=0A>=0A>=0A>=0A>=0A> ________________________________=0A> From:
Pid * =
<pid@pidster.com>=0A> To: Tomcat Users List <users@tomcat.apache.org>=0A>
S=
ent: Tuesday, December 6, 2011 8:12:40 PM=0A> Subject: Re: MVC or Model2 wi=
th Tomcat=0A>=0A> <snip>=0A>=0A> On 6 Dec 2011, at 15:52, Blaxton <blaxxton=
@yahoo.com> wrote:=0A>>=0A>> I have added the host directive to=0A> server.=
xml and moved appexmp1 contents to ROOT directory=0A>> and now I can access=
 www.mydomain.com/index.jsp with no problem,=0A>> however now the servlets =
are not working.=0A>> I can access jsp files, but no servlets, I get "The r=
equested resource is not available" message.=0A>>=0A>> as with following di=
rection:=0A>> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto=
.html#context.xml_-_approach__1=0A>>=0A>> I have created /Catalina_BASE/app=
exmp1/ROOT/META-INF/context.xml=0A>=0A> Ok, please remove the comments from=
 your server.xml and post it inline, here.=0A>=0A>=0A>> I have placed a Hel=
loWorld.class file in /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydom=
ain=0A>> but can't access the class through mydomain.com/app1/HelloWorld=0A=
>=0A> How have you defined the Servlet in=0A> ROOT/WEB-INF/web.xml?=0A>=0A>=
=0A>> tried following context file variations but didn't work:=0A>>=0A>>
<C=
ontext path=3D"/app1" docBase=3D"." debug=3D"0" reloadable=3D"true" crossCo=
ntext=3D"true">=0A>> </Context>=0A>=0A> Never do the above.=0A>=0A>=0A>>
<C=
ontext path=3D"/app1" docBase=3D"ROOT" debug=3D"0" reloadable=3D"true" cros=
sContext=3D"true">=0A>> </Context>=0A>=0A> Or that.=0A>=0A> The
'path' attr=
ibute is not applicable here - in any case it's wrong.=0A>=0A> Remove the p=
ath and docBase attributes from the ROOT.xml file.=0A>=0A>=0A> p=0A>=0A>>
i=
t seems to me , context file is not being read after adding the host direct=
ive to server.xml=0A>> either when it is in /Catalina_BASE/conf/Catalina/lo=
cal host or now that it is in=0A>> /Catalina_BASE/appexmp1/ROOT/META-INF/co=
ntext.xml=0A>>=0A>> thanks for help=0A>=0A> -------------------------------=
--------------------------------------=0A> To unsubscribe, e-mail: users-un=
subscribe@tomcat.apache.org=0A> For additional commands, e-mail: users-help=
@tomcat.apache.org=0A>=0A>=0A> OK, my mistake, I had JkMount /*.jsp and /ap=
p1/* rather than JkMount /* in httpd-vhost.com=0A> changed it as you mentio=
ned to JkMount /* and servlets works now.=0A>=0A> Also removed path and doc=
base from context.xml=0A> so we can't have default application in ROOT and =
path in context file ?=0A>=0A> haven't tried it , but I think we could achi=
eve the same thing with JkAutoAlias=0A> which one is recommended ? JkAutoAl=
ias or adding host directive in server.xml ?=0A>=0A> Thank you very much fo=
r help=0A> I achieved what i was looking for.=0A>=0A>=0A>=0A> -------------=
---------------------------------------------------------------------------=
----------------------------------------=0A>=0A> Sorry but there is one mor=
e problem.=0A>=0A> now that I have JkMount /* in vhost1_httpd.conf=0A> ever=
y thing will be forwarded to tomcat other than *.html because there is=0A> =
a JkUnMount /*.html line in vhost1_httpd.conf but still when I browse=0A> m=
ydomain.com/ I get the tomcat error=0A> "The requested resource() is not av=
ailable".=0A> why is that ?=0A=0ASome mod_jk config voodoo is bubbling up i=
nto my memory.=0A=0AI can't see it in the docs, but try:=0A=0AJKMount /|* w=
orker=0A=0AWhich version of mod_jk are you using?=0A=0A=0A> I have added we=
lcome directive to web.xml as follow:=0A> <welcome-file-list>=0A> <welcome-=
file>index.html</welcome-file>=0A> </welcome-file-list>=0A=0AThis tells
Tom=
cat to look for index.html in its own resource location.=0AIs it there or a=
re you expecting HTTPD to do that for you?=0A=0AI think you probably want t=
o put index.jsp instead.=0A=0A=0A> and following is DirectoryIndex in vhost=
1_httpd.conf file:=0A> DirectoryIndex index.jsp index.html index.php=0A=0A=
=0A=0A> I can access mydomain.com/index.html=0A> but getting error when acc=
essing mydomain.com/=0A=0ACheck the access logs to see which server is send=
ing the file.=0A=0A=0Ap=0A=0A----------------------------------------------=
-----------------------=0ATo unsubscribe, e-mail: users-unsubscribe@tomcat.=
apache.org=0AFor additional commands, e-mail: users-help@tomcat.apache.org=
=0A=0A=0AOk, thanks=0A=0AI have added =0AJkUnMount /=A0 appexmp1worker=0A=
=0Aand with following directive:=0ADirectoryIndex=A0 index.html =0A=0AI can=
 access mydomain.com/ and the default index.html will be displayed.=0A=0Aho=
wever, with =0ADirectoryIndex=A0 index.jsp=0A=0Abecause of JkMount=A0 /* =
=0A=0Aall requests , including .jsp files would be forwarded to tomcat and=
=0AI should place index.jsp file where we defined the appbase.=0A=0AThanks =
again
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message