Re: Best way to...
Loïc Lefèvre at [EMAIL PROTECTED] wrote: > Hi, > I would like to know what is the best way to > change tomcat package? > > Encoutering many problems with mod_rewrite + tomcat serlvet aliasing, > I want to plug some code to enhance the way url-pattern are managed > (by using jakarta oro). > > Have someone already work with this? > Any idea? Do you want to do something like a mod_rewrite in Java for Tomcat? :) Would be cool :) Can't you use a Servlet and a RequestDispatcher? Pier
RE: Best way to...
Yes seems to be one response to my problems and perhaps your problems... ;) What you have to do is to: replace: by then take SimpleMapper1.java (from the src .tar.gz file) and play with it. The point where you must work is in the "contextMap" method: public int contextMap( Request req ) { log("contextMap( "+req.toString()+" )"); // return req.getRequestURI() String path = req.getRequestURI(); if( path==null) throw new RuntimeException("ASSERT: null path in request URI"); // Place to modify path... if( path.indexOf("?") >=0 ) throw new RuntimeException("ASSERT: ? in requestURI"); try { String host=req.getServerName(); if(debug>0) cm.log("Host = " + host); Container container =(Container)map.getLongestPrefixMatch( host, path ); if( container == null ) return 404; ... You see that the main problem is to find the good container from the path else you got a "404 page not found error". So you can manage the path variable to reflect what you want... note: decompiling the class MatcherDemoApplet.class in the jakarta-oro-2.04.tar.gz package could give you a way to manage it and thus enhance considerably Tomcat servlet aliasing ;) Loïc Lefèvre If you can't have something... Build it! -Message d'origine- De : Pier P. Fumagalli [mailto:[EMAIL PROTECTED]] Envoyé : mardi 31 juillet 2001 12:15 À : [EMAIL PROTECTED] Objet : Re: Best way to... Loïc Lefèvre at [EMAIL PROTECTED] wrote: > Hi, > I would like to know what is the best way to > change tomcat package? > > Encoutering many problems with mod_rewrite + tomcat serlvet aliasing, > I want to plug some code to enhance the way url-pattern are managed > (by using jakarta oro). > > Have someone already work with this? > Any idea? Do you want to do something like a mod_rewrite in Java for Tomcat? :) Would be cool :) Can't you use a Servlet and a RequestDispatcher? Pier
Re: best way to debug JSP's ???
Jim, > [what is the best way to debug JSP's ???] The very best thing to do with JSPs is never put any Java code into them. If you can avoid that, and always use taglibs or other JSP directives, etc. then you'll be much better off. (BTW, is there a way to get at the servlet that's generated by compiling the JSP?) Yes. Tomcat generates the .java source files into a directory called "work" which contains a directory structure similar to that of your webapps directory. Poke around in there and you should be able to see the source files for your JSPs. -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to debug JSP's ???
Hola, >I hope this isn't terribly off topic, but I couldn't think of a better >list... No, it's not off topic. Best way to debug JSPs? Hmm, how about not use any? Just kidding. (Partially). - Have plenty of logging statements in the JSP, outputting various variable values. >(BTW, is there a way to get at the servlet that's generated by compiling >the >JSP?) It's in the $CATALINA_HOME/work/[engine]/[host]/[context] directory. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to debug JSP's ???
One of the techniques I use alot is to include a JSP at the bottom of every page that is essentially a JSP Debugging page. This code mines all of the JSP objects and displays all of the values. I can toggle on or off what I want to see and when I go to production I either comment out the include or remove it. I also use log4j within my JSPs so that I can include info, warn and debug output from the JSPs in my web app log. Whenever I wonder what is going on in a page I uncomment the debugging include and almost always this leads me right to the source of the problem. cheers, don jones -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Wed 11/5/2003 8:06 AM To: Tomcat Users List Cc: Subject: RE: best way to debug JSP's ??? Hola, >I hope this isn't terribly off topic, but I couldn't think of a better >list... No, it's not off topic. Best way to debug JSPs? Hmm, how about not use any? Just kidding. (Partially). - Have plenty of logging statements in the JSP, outputting various variable values. >(BTW, is there a way to get at the servlet that's generated by compiling >the >JSP?) It's in the $CATALINA_HOME/work/[engine]/[host]/[context] directory. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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]
RE: best way to debug JSP's ???
Thanks for all the responses! jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to debug JSP's ???
Don, Could you send a copy of your JSP debugging page? Thanks, jim -Original Message- From: Don Jones [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 9:18 AM To: Tomcat Users List Subject: RE: best way to debug JSP's ??? One of the techniques I use alot is to include a JSP at the bottom of every page that is essentially a JSP Debugging page. This code mines all of the JSP objects and displays all of the values. I can toggle on or off what I want to see and when I go to production I either comment out the include or remove it. I also use log4j within my JSPs so that I can include info, warn and debug output from the JSPs in my web app log. Whenever I wonder what is going on in a page I uncomment the debugging include and almost always this leads me right to the source of the problem. cheers, don jones -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Wed 11/5/2003 8:06 AM To: Tomcat Users List Cc: Subject: RE: best way to debug JSP's ??? Hola, >I hope this isn't terribly off topic, but I couldn't think of a better >list... No, it's not off topic. Best way to debug JSPs? Hmm, how about not use any? Just kidding. (Partially). - Have plenty of logging statements in the JSP, outputting various variable values. >(BTW, is there a way to get at the servlet that's generated by compiling >the >JSP?) It's in the $CATALINA_HOME/work/[engine]/[host]/[context] directory. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to debug JSP's ???
> The very best thing to do with JSPs is never put any Java code into > them. If you can avoid that, and always use taglibs or other JSP > directives, etc. then you'll be much better off. I second the use of tag libraries. Also, with a decent IDE (such as Eclipse) you can refactor the code in your tab libraries without breaking your JSPs. Harry Mantheakis London - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best Way to Share Webapps?
Use cascading style sheets that reside on the web server to set the look/feel for any jsp output. With a jk1 connector, you can use the same app server in many different web servers. I'd suggest setting up an ajp13 connector in the server.xml for each different web server you wish to connect from so you can set the thread limits independant for each web server. Byron -Original Message- From: Pete Lamborne [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 19, 2005 10:39 AM To: tomcat-user@jakarta.apache.org Subject: Best Way to Share Webapps? Hi, I'm just looking for the best way to include/embed single instances of webapps across various websites. This includes the ability to wrap the webapps in each website's look and feel. What solutions have others used or would you use to achieve this? Thanks, pete. - 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]
Re: Best way to deploy an application?
Topic most likely to start a flame war. I like to do things manually. In 4.0 - I always edit server.xml and keep my webapps out of the webapps dir. By doing a manual restart - I can guarantee when my JVM crashes (or other stuff occurs) - I can guarantee it will restart. In 4.1 - I plop an XML file in the webapps dir (with the context config) and my webapps still reside somewhere else. -Tim Riaan Oberholzer wrote: As far as I can see, you can deploy a .war in three ways: 1) Dump it in the webapps dir 2) Deploy it with the console 3) Use the ant tasks in the catalina-ant.jar I use #3, particularly in development it is the fastest. Which one is recommended and what are the pro's & cons of them? Why should/shouldn't I use one or more of these methods? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to deploy an application?
Howdy, I think it's enlightening to see two tomcat developers using different methods for the same task: I do almost the opposite of what Tim does ;) I like to keep the .war files packed, my server set to unpackWARs="false", autoDeploy="false", and I use an ant task (self-written, not from catalina-ant.jar, but very close) that assembles the .war file and copies it into the webapps directory. I restart the server manually. All the approaches are fine I think. It's nice to have choices. Yoav Shapira Millennium ChemInformatics >-Original Message- >From: Tim Funk [mailto:[EMAIL PROTECTED] >Sent: Wednesday, June 18, 2003 7:02 AM >To: Tomcat Users List >Subject: Re: Best way to deploy an application? > >Topic most likely to start a flame war. > >I like to do things manually. In 4.0 - I always edit server.xml and keep my >webapps out of the webapps dir. By doing a manual restart - I can guarantee >when my JVM crashes (or other stuff occurs) - I can guarantee it will >restart. > >In 4.1 - I plop an XML file in the webapps dir (with the context config) >and >my webapps still reside somewhere else. > >-Tim > >Riaan Oberholzer wrote: >> As far as I can see, you can deploy a .war in three >> ways: >> >> 1) Dump it in the webapps dir >> 2) Deploy it with the console >> 3) Use the ant tasks in the catalina-ant.jar >> >> I use #3, particularly in development it is the >> fastest. >> >> Which one is recommended and what are the pro's & cons >> of them? Why should/shouldn't I use one or more of >> these methods? >> > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Way to Connect to httpd 2.0.40?
I use WebApp, but that seems to be not the one for the future. I just posted a reply on another question with config extract included for WebApp. It works fine and it is really easy to understand what's happening. Bert Catsburg Marc Boorshtein wrote: Hello, I am trying to setup tomcat to work with apache 2.0.40 on a redhat 8 machine. I tried mod_jk but, apache sys it's not compatible. Is there a way to build mod_jk for 2.0.40? Is there a binary? I would REALLY prefer not to compile apache, as the machine does not currently have any development libraries installed. Thanks for the help Marc Boorshtein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best Way to Connect to httpd 2.0.40?
If your machine has no development environment, you're basically out of luck. Apache modules are version-sensitive. .43 and .44 are module compatible, but earlier versions of Apache are not compatible with modules compiled for later versions. All of the binaries that I'm aware of are for .43/.44. I do know that RH announced that they had backported all of the Apache fixes in .41, .42, .43, and .44 to their .40, but I haven't tested it and have no idea if a JK/JK2 binary compiled against .43/.44 will work with their munged .40, assuming you've applied all of RH's updates. My guess is, it won't. I know you probably don't want to hear this, but the recommended configuration is .44, not because of Tomcat and/or Tomcat connectors, but because of the Apache fixes (including some security fixes) between .40 and .44. If your machine doesn't have a development environment, it sounds like it will be a production server, so keeping current with httpd fixes is probably the way to go. John > -Original Message- > From: Marc Boorshtein [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 12, 2003 6:51 AM > To: Tomcat Users List > Subject: Best Way to Connect to httpd 2.0.40? > > > Hello, > > I am trying to setup tomcat to work with apache 2.0.40 on a redhat 8 > machine. I tried mod_jk but, apache sys it's not compatible. > Is there > a way to build mod_jk for 2.0.40? Is there a binary? I would REALLY > prefer not to compile apache, as the machine does not > currently have any > development libraries installed. > > Thanks for the help > Marc Boorshtein > > -- > Marc Boorshtein <[EMAIL PROTECTED]> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best way to install Apache, Tomcat and Jboss
Utech - Han Lim at [EMAIL PROTECTED] wrote: > Hi, does anybody here can explain step by step the best way to install > Apache+Tomcat+Jboss? Or any reference will be appreciated. Thanks. For Apache and Tomcat, look at the website. For Jboss, you got the wrong mailing list :) Pier
Re: best way to handle Servlets+JSPs+multiple Frames?
Jsp is no different from other when it comes to client side. Why don't you just link the client actions to specific or generic Jsp pages just as normal! Original Message - From: Sebastian Schulz To: [EMAIL PROTECTED] Sent: Wednesday, February 21, 2001 5:06 PM Subject: best way to handle Servlets+JSPs+multiple Frames? hi, i want to develop a WebApplication using Servlets+JSPs+JavaBeans. (MVC) So far no problems. But on client-side i need a frame-based solution. Every Frame itself is a JSP. The following i need to get working as smart as possible: User-action at one Frame causes the Servlet to change this but also all the other JSP-Frames acording to the current action. I know i can do this by including a JavaScript-Function which produces a request for every Frame to the Servlet. This sucks because of: - i need JavaScript - it is not smart and will lead to bad performance because of multiple, redundant requests - it is quite dangerous for some (altering) operations, which shold take place only one times! so i would be very glad, if someone have a more elegant solution! may be there is a "best way" for this kind of problem... thanks in advance. bAs T.
Re: best way to handle Servlets+JSPs+multiple Frames?
hi Stephen, thank you for your solution. But if i'm not mistaken your example needs no session (therefor the redirection, right?) Then it's no problem to have one frame making the Request and the Servlet after doing its job redirects to the URL with the Frameset. But i need session-support for the whole Lifetime of the WebApplication, so thats my abstract use-case: request (for instance form-data) from one frame, servlet validates and changes some Java-Objects, putting them back to session, then _dispatching_ , better _forwarding_ the request to the frameset. because the frameset consists of several "JSP-Frames", whitch all needs access to the session-object, i can not dispatch to the frameset, instead i have to dispatch to that frame, which has made the request (with help from a JavaScript-Function). Am I wrong? here some code-snippets: frame with form, action as a redirection to a JavaScript-Function: function dispatchFrames(servletpath){ /* reading form-parameters etc. then dispatching for that frames who need access to modified session-object: */ parameterlist=. parent.frames[0].location.href=servletpath+"?"+parameterlist; parent.frames[1].location ...same ... and so on Servlet: /* doGet() + doPost(): */ ...public void doIt(...) ... /* get my Object from Session: */ object = (cast)session.getSessionAttribute(..); /* changing the object acording to request-parameters */ /* no explicit store back, because call by reference */ /* dispatch to that file(jsp), the requesting frame should display now: */ RequestDispatcher rd = getServletContext().getRequestDispatcher(url); try{ ... ... res.setHeader(... rd.forward(req,res); this is my solution, witch work also with session-suport for frames, but i'm not very happy with it. bAs T. - Original Message - From: Jones, Stephen <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 21, 2001 6:51 PM Subject: RE: best way to handle Servlets+JSPs+multiple Frames? > In our product, we use forms to POST user input data. We usually send the > input to another JSP page, but I don't see why this would not work for a > servlet's doPost(HttpServletRequest, HttpServletResponse) method. > > e.g.: > action="UserMod_Ctl.jsp" target="_top"> > <% /* form stuff here, buttons, textfields, etc */ %> > > > When the servlet has made its controller-decisions, it then performs a > URL-redirect to the new HTML frameset desired (sURL), according to biz > logic, e.g.: > > response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); > response.setHeader("Location", sURL); > > (this is a cookie-safe redirect) > > I'm sure there are other ways, as well. > Steve > > -Original Message- > From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 10:07 AM > To: [EMAIL PROTECTED] > Subject: best way to handle Servlets+JSPs+multiple Frames? > > > hi, > > i want to develop a WebApplication > using Servlets+JSPs+JavaBeans. > (MVC) > > So far no problems. > > But on client-side i need a frame-based solution. > Every Frame itself is a JSP. The following i need to > get working as smart as possible: > > User-action at one Frame causes the Servlet to change > this but also all the other JSP-Frames acording to the > current action. > > I know i can do this by including a JavaScript-Function > which produces a request for every Frame to the Servlet. > > This sucks because of: > - i need JavaScript > - it is not smart and will lead to bad performance because of multiple, > redundant requests > - it is quite dangerous for some (altering) operations, which > shold take place only one times! > > so i would be very glad, if someone have a more elegant solution! > may be there is a "best way" for this kind of problem... > thanks in advance. > > bAs T. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: best way to handle Servlets+JSPs+multiple Frames?
But I think that his orginal point was this does not seem like an efficient solution - you end up loading the frameset for every page, as well as all the dependent pages. What we have done is to make one Frame the "Controlling" frame. All actions take place in this frame. Then, for our menu bars, title bars, button bars, etc we create pages that are mostly JavaScript. From the Controlling Frame, we tell the dependent frame to create their HTML based upon the function parameters. (For example, each page calls fames[x].setMenus(labels, actions), which generates the html for our menus and then sets the innerHTML for a paticular span to the html just generated.) This does end up with a lot of JavaScript on the client, however it makes the design just about as clean as a non-frame set implementation. It also moves some of the processing from the server out to the client (for those worried about the load on their servers). Randy -Original Message- From: Jones, Stephen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 12:52 PM To: '[EMAIL PROTECTED]' Subject: RE: best way to handle Servlets+JSPs+multiple Frames? In our product, we use forms to POST user input data. We usually send the input to another JSP page, but I don't see why this would not work for a servlet's doPost(HttpServletRequest, HttpServletResponse) method. e.g.: <% /* form stuff here, buttons, textfields, etc */ %> When the servlet has made its controller-decisions, it then performs a URL-redirect to the new HTML frameset desired (sURL), according to biz logic, e.g.: response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); response.setHeader("Location", sURL); (this is a cookie-safe redirect) I'm sure there are other ways, as well. Steve -Original Message- From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 10:07 AM To: [EMAIL PROTECTED] Subject: best way to handle Servlets+JSPs+multiple Frames? hi, i want to develop a WebApplication using Servlets+JSPs+JavaBeans. (MVC) So far no problems. But on client-side i need a frame-based solution. Every Frame itself is a JSP. The following i need to get working as smart as possible: User-action at one Frame causes the Servlet to change this but also all the other JSP-Frames acording to the current action. I know i can do this by including a JavaScript-Function which produces a request for every Frame to the Servlet. This sucks because of: - i need JavaScript - it is not smart and will lead to bad performance because of multiple, redundant requests - it is quite dangerous for some (altering) operations, which shold take place only one times! so i would be very glad, if someone have a more elegant solution! may be there is a "best way" for this kind of problem... thanks in advance. bAs T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: best way to handle Servlets+JSPs+multiple Frames?
Sebastian: I do not understand any added significance with regards to session information. All JSP pages and servlets have access to the session Object provided by Tomcat. The session is shared across any number of different requests coming in from the client... What I mean is that any page can retrieve the object your servlet has modified, the same way the servlet got it: object = (cast) session.getAttribute(..); Really, though-- it seems like your object should be a session-scope bean. Then the "view" JSP pages can retrieve the object via useBean tags. Steve > -Original Message- > From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 12:10 PM > To: [EMAIL PROTECTED] > Subject: Re: best way to handle Servlets+JSPs+multiple Frames? > > > hi Stephen, > > thank you for your solution. > > But if i'm not mistaken your example needs > no session (therefor the redirection, right?) > > Then it's no problem to have one frame > making the Request and the Servlet after > doing its job redirects to the URL with the > Frameset. > > But i need session-support for the whole Lifetime > of the WebApplication, so thats my abstract use-case: > > request (for instance form-data) from one frame, servlet > validates and changes some Java-Objects, putting them > back to session, then _dispatching_ , better _forwarding_ > the request to the frameset. > because the frameset consists of several "JSP-Frames", whitch all > needs access to the session-object, i can not dispatch to the > frameset, instead i have to dispatch to that frame, which has made the > request (with help from a JavaScript-Function). > > Am I wrong? > > here some code-snippets: > > frame with form, action as a redirection to a JavaScript-Function: > action="javascript:dispatchFrames('Servlet-Path')"> > > > > function dispatchFrames(servletpath){ > /* reading form-parameters etc. > then dispatching for that frames who need access to modified > session-object: > */ > parameterlist=. > > parent.frames[0].location.href=servletpath+"?"+parameterlist; > parent.frames[1].location ...same > ... and so on > > Servlet: > /* doGet() + doPost(): */ > ...public void doIt(...) ... > /* get my Object from Session: */ > object = (cast)session.getSessionAttribute(..); > /* changing the object acording to request-parameters */ > /* no explicit store back, because call by reference */ > /* dispatch to that file(jsp), the requesting frame should > display now: */ > RequestDispatcher rd = getServletContext().getRequestDispatcher(url); > try{ > ... > ... > res.setHeader(... > rd.forward(req,res); > > > this is my solution, witch work also with session-suport for frames, > but i'm not very happy with it. > > bAs T. --SNIP-- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: best way to handle Servlets+JSPs+multiple Frames?
In our product, we use forms to POST user input data. We usually send the input to another JSP page, but I don't see why this would not work for a servlet's doPost(HttpServletRequest, HttpServletResponse) method. e.g.: <% /* form stuff here, buttons, textfields, etc */ %> When the servlet has made its controller-decisions, it then performs a URL-redirect to the new HTML frameset desired (sURL), according to biz logic, e.g.: response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); response.setHeader("Location", sURL); (this is a cookie-safe redirect) I'm sure there are other ways, as well. Steve -Original Message- From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 10:07 AM To: [EMAIL PROTECTED] Subject: best way to handle Servlets+JSPs+multiple Frames? hi, i want to develop a WebApplication using Servlets+JSPs+JavaBeans. (MVC) So far no problems. But on client-side i need a frame-based solution. Every Frame itself is a JSP. The following i need to get working as smart as possible: User-action at one Frame causes the Servlet to change this but also all the other JSP-Frames acording to the current action. I know i can do this by including a JavaScript-Function which produces a request for every Frame to the Servlet. This sucks because of: - i need JavaScript - it is not smart and will lead to bad performance because of multiple, redundant requests - it is quite dangerous for some (altering) operations, which shold take place only one times! so i would be very glad, if someone have a more elegant solution! may be there is a "best way" for this kind of problem... thanks in advance. bAs T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: best way to handle Servlets+JSPs+multiple Frames?
hi Stephen, thank you for your solution. But if i'm not mistaken your example needs no session (therefor the redirection, right?) Then it's no problem to have one frame making the Request and the Servlet after doing its job redirects to the URL with the Frameset. But i need session-support for the whole Lifetime of the WebApplication, so thats my abstract use-case: request (for instance form-data) from one frame, servlet validates and changes some Java-Objects, putting them back to session, then _dispatching_ , better _forwarding_ the request to the frameset. because the frameset consists of several "JSP-Frames", whitch all needs access to the session-object, i can not dispatch to the frameset, instead i have to dispatch to that frame, which has made the request (with help from a JavaScript-Function). Am I wrong? here some code-snippets: frame with form, action as a redirection to a JavaScript-Function: function dispatchFrames(servletpath){ /* reading form-parameters etc. then dispatching for that frames who need access to modified session-object: */ parameterlist=. parent.frames[0].location.href=servletpath+"?"+parameterlist; parent.frames[1].location ...same ... and so on Servlet: /* doGet() + doPost(): */ ...public void doIt(...) ... /* get my Object from Session: */ object = (cast)session.getSessionAttribute(..); /* changing the object acording to request-parameters */ /* no explicit store back, because call by reference */ /* dispatch to that file(jsp), the requesting frame should display now: */ RequestDispatcher rd = getServletContext().getRequestDispatcher(url); try{ ... ... res.setHeader(... rd.forward(req,res); this is my solution, witch work also with session-suport for frames, but i'm not very happy with it. bAs T. - Original Message - From: Jones, Stephen <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 21, 2001 6:51 PM Subject: RE: best way to handle Servlets+JSPs+multiple Frames? > In our product, we use forms to POST user input data. We usually send the > input to another JSP page, but I don't see why this would not work for a > servlet's doPost(HttpServletRequest, HttpServletResponse) method. > > e.g.: > action="UserMod_Ctl.jsp" target="_top"> > <% /* form stuff here, buttons, textfields, etc */ %> > > > When the servlet has made its controller-decisions, it then performs a > URL-redirect to the new HTML frameset desired (sURL), according to biz > logic, e.g.: > > response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); > response.setHeader("Location", sURL); > > (this is a cookie-safe redirect) > > I'm sure there are other ways, as well. > Steve > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: best way to handle Servlets+JSPs+multiple Frames?
You can target any frame for the result to go to in your form tag e.g. -Original Message- > From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 11:10 AM > To: [EMAIL PROTECTED] > Subject: Re: best way to handle Servlets+JSPs+multiple Frames? > > > hi Stephen, > > thank you for your solution. > > But if i'm not mistaken your example needs > no session (therefor the redirection, right?) > > Then it's no problem to have one frame > making the Request and the Servlet after > doing its job redirects to the URL with the > Frameset. > > But i need session-support for the whole Lifetime > of the WebApplication, so thats my abstract use-case: > > request (for instance form-data) from one frame, servlet > validates and changes some Java-Objects, putting them > back to session, then _dispatching_ , better _forwarding_ > the request to the frameset. > because the frameset consists of several "JSP-Frames", whitch all > needs access to the session-object, i can not dispatch to the > frameset, instead i have to dispatch to that frame, which has made the > request (with help from a JavaScript-Function). > > Am I wrong? > > here some code-snippets: > > frame with form, action as a redirection to a JavaScript-Function: > action="javascript:dispatchFrames('Servlet-Path')"> > > > > function dispatchFrames(servletpath){ > /* reading form-parameters etc. > then dispatching for that frames who need access to modified > session-object: > */ > parameterlist=. > > parent.frames[0].location.href=servletpath+"?"+parameterlist; > parent.frames[1].location ...same > ... and so on > > Servlet: > /* doGet() + doPost(): */ > ...public void doIt(...) ... > /* get my Object from Session: */ > object = (cast)session.getSessionAttribute(..); > /* changing the object acording to request-parameters */ > /* no explicit store back, because call by reference */ > /* dispatch to that file(jsp), the requesting frame should > display now: */ > RequestDispatcher rd = getServletContext().getRequestDispatcher(url); > try{ > ... > ... > res.setHeader(... > rd.forward(req,res); > > > this is my solution, witch work also with session-suport for frames, > but i'm not very happy with it. > > bAs T. > > - Original Message - > From: Jones, Stephen <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, February 21, 2001 6:51 PM > Subject: RE: best way to handle Servlets+JSPs+multiple Frames? > > > > In our product, we use forms to POST user input data. We > usually send the > > input to another JSP page, but I don't see why this would > not work for a > > servlet's doPost(HttpServletRequest, HttpServletResponse) method. > > > > e.g.: > > > action="UserMod_Ctl.jsp" target="_top"> > > <% /* form stuff here, buttons, textfields, etc */ %> > > > > > > When the servlet has made its controller-decisions, it then > performs a > > URL-redirect to the new HTML frameset desired (sURL), > according to biz > > logic, e.g.: > > > > response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); > > response.setHeader("Location", sURL); > > > > (this is a cookie-safe redirect) > > > > I'm sure there are other ways, as well. > > Steve > > > > -Original Message- > > From: Sebastian Schulz [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 10:07 AM > To: [EMAIL PROTECTED] > Subject: best way to handle Servlets+JSPs+multiple Frames? > > > hi, > > i want to develop a WebApplication > using Servlets+JSPs+JavaBeans. > (MVC) > > So far no problems. > > But on client-side i need a frame-based solution. > Every Frame itself is a JSP. The following i need to > get working as smart as possible: > > User-action at one Frame causes the Servlet to change > this but also all the other JSP-Frames acording to the > current action. > > I know i can do this by including a JavaScript-Function > which produces a request for every Frame to the Servlet. > > This sucks because of: > - i need JavaScript > - it is not smart and will lead to bad performance because of multiple, > redundant requests > - it is quite dangerous for some (altering) operations, which > shold take place only one times! > > so i would be very glad, if someone have a more elegant solution! > may be there is a "best way" for this kind of problem... > thanks in advance. > > bAs T. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: best way to setup multiple instances of tomcat
The easiest way is to run multiple copies. For example: /usr/local/tomcat1/ ... /usr/local/tomcat2/ ... /usr/local/tomcat.../ ... If the configurations are the same, then you can use the same copy of server.xml for all the instances. Then for items which need to be different such as port and ip address, use you pass system properties on startup and have them substitued in server.xml. export JAVA_OPTS='-Dfoo=8080' -Tim Greg Lappen wrote: Hello- I currently am using Tomcat 5.0.28 for both our production and test server. Currently, I have one copy of the tomcat distribution in /usr/local/tomcat, two different server.xml files (server-prod.xml and server-test.xml) in /usr/local/tomcat/conf and two different scripts in /etc/init.d to start the prod and test servers. Each server has its own directory under /usr/local/tomcat/conf/Catalina, and the ROOT.xml file in each case defines a different log file for the application. Everything seems to work fine, but both instances are writing to /usr/local/tomcat/logs/catalina.out. My question is can the filename "catalina.out" be controlled so each instance writes to a different file? Also, I'm thinking that I probably don't want them both running off the same install directory because what if I want to test a new version of Tomcat in the test environment? The only thing I'm saving by having them both run from the same directory is a few megs of space right? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to setup multiple instances of tomcat
Greg Lappen wrote: Also, I'm thinking that I probably don't want them both running off the same install directory because what if I want to test a new version of Tomcat in the test environment? The only thing I'm saving by having them both run from the same directory is a few megs of space right? Hi Greg, you might search for the file RUNNING.txt in /usr/local/tomcat for more information. There were other threads on 9th and 13th December 2004 in this list discussing the same topic. Your particular problem can be solved by specifying the appropriate parameter (-outfile) when starting your tomcats using jsvc (the java commons daemon). I wrote a script and a short description for installation of multiple tomcat instances and put it to http://miti.sourceforge.net/ . Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best way to capture Stack Trace when Tomcat Failes complete?
2 easy(but not the only) ways: 1 - Hack catalina.bat to redirect standard output to a file. 2 - Use cygwin and stdout/error will go to logs/catalina.out -Tim Matt Fury wrote: Hi All, I am doing some native programming with Java and C++ DLL. The DLL works the first time around through a JSP page but the second time around it crashes Tomcat completely. Unfortunately the Stack Trace prints out in the console but the console shuts down before I can read it. Is there a way to capture that information to a log file since its low-level? -Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]