You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mattias Carlehäll <mc...@fornby.fhsk.se> on 2003/03/27 12:57:39 UTC
Javascript and tomcat
Hi
Is there something I have to setup to run a javascrip with tomcat? Used
it with orion server before and it worked fine, but with tomcat nothing
happens (my webbrowser won't even tell me that there's a script error).
My script looks like this:
function submitRequest(str) {
document.forms[0].linkName.value=str;
document.forms[0].submit();
}
function submit() {
alert("nisse var en liten man")
document.forms[0].submit();
}
function submitTeacher(str) {
document.forms[0].teacherClasses.value=str;
document.forms[0].submit();
}
To run it I click on a link that looks like this:
<form method=post action="/servlet/admin" name="view">
<input type=hidden name="FormName" value="view">
<input type=hidden name="type" value="teacher">
<input type=hidden name="id" value=$object.getCivicNo()>
<td><a href="#" onClick="submit()">Visa</a></td>
</form>
/Mattias
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Javascript and tomcat
Posted by Tim Funk <fu...@joedog.org>.
Javascript and the webserver are independent of one another since
javascript runs on the client.
My guess is velocity isn't running on the tomcat. If you have both web
server instances available, I would save the output source from both and
diff them and hope something helpful shows up.
-Tim
Mattias Carlehäll wrote:
> Forgot to tell that I use velocity also, so $object is an object of some
> type, In this case a student. (context.put("object",studentObject))
>
>
>
>>I think Orion is doing extra server parsing. Because of this line:
>>
>><input type=hidden name="id" value=$object.getCivicNo()>
>> ^^^^^
>>"$object.getCivicNo()" is probably being translated by Orion into
>>something else but tomcat doesn't handle that syntax.
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Javascript and tomcat
Posted by Mattias Carlehäll <mc...@fornby.fhsk.se>.
Forgot to tell that I use velocity also, so $object is an object of some
type, In this case a student. (context.put("object",studentObject))
> I think Orion is doing extra server parsing. Because of this line:
>
> <input type=hidden name="id" value=$object.getCivicNo()>
> ^^^^^
> "$object.getCivicNo()" is probably being translated by Orion into
> something else but tomcat doesn't handle that syntax.
>
>
>
> -Tim
>
> Mattias Carlehäll wrote:
> > Hi
> >
> > Is there something I have to setup to run a javascrip with tomcat?
> Used
> > it with orion server before and it worked fine, but with tomcat
> nothing
> > happens (my webbrowser won't even tell me that there's a script
> error).
> >
> > My script looks like this:
> >
> > function submitRequest(str) {
> > document.forms[0].linkName.value=str;
> > document.forms[0].submit();
> > }
> >
> > function submit() {
> > alert("nisse var en liten man")
> > document.forms[0].submit();
> > }
> >
> >
> > function submitTeacher(str) {
> > document.forms[0].teacherClasses.value=str;
> > document.forms[0].submit();
> > }
> >
> > To run it I click on a link that looks like this:
> >
> > <form method=post action="/servlet/admin" name="view">
> > <input type=hidden name="FormName" value="view">
> > <input type=hidden name="type" value="teacher">
> > <input type=hidden name="id" value=$object.getCivicNo()>
> > <td><a href="#" onClick="submit()">Visa</a></td>
> > </form>
> >
> >
> > /Mattias
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Javascript and tomcat
Posted by Tim Funk <fu...@joedog.org>.
I think Orion is doing extra server parsing. Because of this line:
<input type=hidden name="id" value=$object.getCivicNo()>
^^^^^
"$object.getCivicNo()" is probably being translated by Orion into
something else but tomcat doesn't handle that syntax.
-Tim
Mattias Carlehäll wrote:
> Hi
>
> Is there something I have to setup to run a javascrip with tomcat? Used
> it with orion server before and it worked fine, but with tomcat nothing
> happens (my webbrowser won't even tell me that there's a script error).
>
> My script looks like this:
>
> function submitRequest(str) {
> document.forms[0].linkName.value=str;
> document.forms[0].submit();
> }
>
> function submit() {
> alert("nisse var en liten man")
> document.forms[0].submit();
> }
>
>
> function submitTeacher(str) {
> document.forms[0].teacherClasses.value=str;
> document.forms[0].submit();
> }
>
> To run it I click on a link that looks like this:
>
> <form method=post action="/servlet/admin" name="view">
> <input type=hidden name="FormName" value="view">
> <input type=hidden name="type" value="teacher">
> <input type=hidden name="id" value=$object.getCivicNo()>
> <td><a href="#" onClick="submit()">Visa</a></td>
> </form>
>
>
> /Mattias
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org