Re: [programmazione] Struts vs JSF (poll?)
Hi, keep in mind that JSF is a very powerful framework, but it has also some limits. The biggest one is that to work correctly javascript must be enabled on the client browser. So, as first, take care this is a very strict specific. Where it is possible i like using JSF (sun), otherwise I go with struts. Using NetBeans and the so called visual JSF (woodstock project) is not mandatory to develop a JSF app. (That is : u can use eclipse :-)) In any case, I suggest to invest in "know how" about the framework u decide to deal with. Also if some tools can give the impression everything is simple to do, a deep knowledge of the choosen framework is always necessary. Regards Luca Cicale -- From: "Tommy Pham" <[EMAIL PROTECTED]> Sent: Sunday, August 24, 2008 7:03 AM To: Subject: [programmazione] Struts vs JSF (poll?) Hi everyone, This maybe out of scope for this list but I wanted to know more about Struts vs JSF other this old article [1]. Which are are deployed mostly on your TC server(s)/cluster(s)? If any Java developers are on this list, which platform API do you prefer for quick development (to meet deadline), performance, security management (user authentication and level restriction) etc... since both are based on MVC despite their different implementations(?). Since there isn't a JSR for Struts, has Struts been around before JCP is formed? And why is there not a JSR for Struts now (just curious)? As for JSF, which implementation is used by/for your app(s)? Sun/NetBeans? Apache's MyFaces? or Others (please list)? I'm somewhat disappointed Netbeans support for JSF and Struts in that Netbeans bundled libs support used older Apache Commons lib version (even for the current v6.1), although this could be updated but I don't know whether it will break the integration of Netbeans' VWP. Even the tutorial/trails on NetBeans site regarding Struts (although this can be compensated at Struts' web site) is very limited perhaps because of the (biased?) Struts weak integration to favor or push more on JSF/Visual JSF? I need to evaluate my options of API and IDE before I dedicate several projects since the performance of Netbeans is getting worse by every release comparing to Eclipse. As for server, I've decided already ;) TIA, Tommy [1] http://websphere.sys-con.com/node/46516 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] how to set context path on TOMCAT6
In the way I explained you create a application specific xml. the META-INF directory containing the context.xml is in your application, in your war file. -- From: "Sushil Dodake" <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2008 9:52 AM To: "Tomcat Users List" Subject: Re: [programmazione] how to set context path on TOMCAT6 my requirement is to create a application specific xml file. am i making any mistake here? On Thu, Aug 21, 2008 at 2:35 AM, Luca Cicale <[EMAIL PROTECTED]> wrote: A simple way is to put in your web application a file named context.xml in META-INF directory, with the following content: then you can produce your war and deploy it as usually (a simple way is to place it in your webapp directory in default tomcat6 configuration) Tomcat6 will make the rest of the job for you. Regards Luca Cicale - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] how to set context path on TOMCAT6
A simple way is to put in your web application a file named context.xml in META-INF directory, with the following content: then you can produce your war and deploy it as usually (a simple way is to place it in your webapp directory in default tomcat6 configuration) Tomcat6 will make the rest of the job for you. Regards Luca Cicale -- From: "Sushil Dodake" <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2008 9:04 AM To: Subject: [programmazione] how to set context path on TOMCAT6 hi all, I am using TOMCAT 6. i have a application war file named as 'aaa.0.0.1d.war' i need to set a context path for this application as '/reporting-application' so for this to work i am creating a xml file 'reporting-application.xml' and deploying it in the conf/Catalina/locahost/ direcotry. the XML file content looks as below i followed the instructions given on the link http://tomcat.apache.org/tomcat-6.0-doc/config/context.html but i am seem to be missing somthing as i cant run my application using a URL - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Redirection
Using a servlet that read the file on the other server and write it in the response should be a good idea. If you need more details I can provide, if you ask for. Regards Luca -- From: "Ravi Sharma" <[EMAIL PROTECTED]> Sent: Friday, August 15, 2008 8:47 PM To: "Tomcat Users List" Subject: [programmazione] Redirection Hi, I have the following scenerio. I have a site which provide music online. Now for hosting the actual song i have purchased another site with better band widthm but no tomcat. So my webserver(tomcat) is running on one server(say domain1) and files are hosted on another (with different domain name say domain2, which anyone can access using http). Now i have to put http://domain2/abc.music on my site to access these files. Now i can do something like that write a normal Servlet which receive song id and i forward it to appropriate link(http link to another site domain2). but when someone start downloading they see that data is coming from domain2, i dont want user to see domain2, and also i can not do somethin like when user request any file first get it on to domain1 server and then provide it to user as it will be too much bandwidth wastage. So is there any way to do this using anything in apache,tomcat to hide domain2 from everyone., Thanks, Ravi. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Bug in tomcat scripts?
i know my question could seem strange to you, but pls: why did you execute "rm -rf $(cwd)/.. && /etc/init.d/tomcat5 restart"? And above all: where? :-) Luca -- From: "Enrique Arizón" <[EMAIL PROTECTED]> Sent: Tuesday, August 12, 2008 7:11 PM To: Subject: [programmazione] Bug in tomcat scripts? I suddenly removed my cwd just prior to start tomcat. Briefly, the script would be similar to: # rm -rf $(cwd)/.. && /etc/init.d/tomcat5 restart after which I got lot of errors and tomcat "broke" (broke == I reinstalled the rpm package to make it work again). The worst thing is that after the first run of the "suicide command" when executing: # /etc/init.d/tomcat5 start doesn't work but doesn't display any errors and returns "OK". The error list is similar to: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No existe el fichero o el directorio Deteniendo tomcat5: [ OK ] Iniciando tomcat5: shell-init: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. shell-init: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. pushd: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. /bin/ln: creating symbolic link «[commons-collections-tomcat5].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[commons-dbcp-tomcat5].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[commons-el].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[commons-pool-tomcat5].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[ecj].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[jaf].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[jasper5-compiler].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[jasper5-runtime].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[javamail].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[jsp].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[servlet].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[tomcat5][naming-factory].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[tomcat5][naming-resources].jar»: File or directory doesn't exists. /usr/share/java-utils/java-functions: line 247: popd: directory stack empty shell-init: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. pushd: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. /bin/ln: creating symbolic link «[jaxp_parser_impl].jar»: File or directory doesn't exists. /bin/ln: creating symbolic link «[xml-commons-jaxp-1.3-apis].jar»: File or directory doesn't exists. /usr/share/java-utils/java-functions: line 247: popd: directory stack empty shell-init: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. pushd: error retrieving current directory: getcwd: cannot access parent directories: File or directory doesn't exists. /bin/ln: creating symbolic link «[catalina-ant5].jar»: File or directory doesn't exists ... /usr/share/java-utils/java-functions: line 247: popd: directory stack empty I was using tomcat5 from standard Mandriva 2008 but probably the error will apply to other Linux distros/OSes where tomcat use a shell to start up. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Re: Tomcat failover
Answering your question: assuming you have a apache web server proxing the first tomcat with mod_jk (so mod_jk help), you shuold have a thread in your second tomcat which interrogate a servlet in the first tomcat and if the answer fails this thread should reconfigure the worker (the mod_jk) so that apache web server redirect the requests to the second tomcat. Honestly it doesn't seems to me to be a solid solution (what about the second tomcat crashes too? what about the sessions in the first tomcat?). A better solution could be clustering: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html Also give a try to terracotta to keep save your sessions. In this case you could also have a typical load balanced cluster with net balancer. Regards Luca Cicale -- From: "Ofer Kalisky" <[EMAIL PROTECTED]> Sent: Tuesday, August 12, 2008 8:30 AM To: "Tomcat Users List" Subject: [programmazione] Re: Tomcat failover Is there a reason why no one is answering this? - Original Message - From: Ofer Kalisky To: Tomcat Users List Sent: Monday, August 11, 2008 3:26 PM Subject: Tomcat failover Hi, I have a Tomcat that has a thread that reads entries from a DB and handles them. In each cycle, it reads all the entries (to a certain limit). I would like to set up a configuration that has a failover Tomcat, that when the first one crashes the second starts to read from the same DB (or a replicated, doesn't matter) and handle entries. I wouldn't want the second Tomcat to read from the DB, because it would harm the operation of the first when the first is up. I would like it to start working only when the first is down... How can I know in the second Tomcat that the first have crashed? can mod_jk help? Thanks. __ Information from ESET NOD32 Antivirus, version of virus signature database 3345 (20080811) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Servlet Caching
Hi, "<[EMAIL PROTECTED]" is a static include, that is at compile time the compiled code of the INCLUDED jsp is simply copied. But if you change a included jsp/servlet after the INCLUDING page has been compiled, well, nothing happens in the INCLUDING. You have to touch (modify something) the including jsp to make it recompiled with the included modified code. An other option is to dinamically include the page using: " Sent: Tuesday, August 12, 2008 1:37 PM To: Subject: [programmazione] Servlet Caching Hi there, I am currently investigating a problem with our web app (Tomcat 5.5.23, Java 1.5, JSF 1.2) where the servlet cache does not always get updated when a JSF include is changed. This happend after changing an included JSF. The JSF-snippet that includes is: <[EMAIL PROTECTED] file="/pages/inc/head.inc"%> [...] <[EMAIL PROTECTED] file="/pages/inc/bbs_header.inc"%> <[EMAIL PROTECTED] file="/pages/inc/menu.inc"%> [...] The JSPServlet config in web.xml: jsp org.apache.jasper.servlet.JspServlet fork false xpoweredBy false 3 Adding development=false and checkInterval=30 to the parameter list did not change anything. Am I missing something or is there a limitation to the JSP Compiler with checking the dependencies? Or is the problem based upon that <[EMAIL PROTECTED] %> are not the way to include subviews in JSF? If you want me to provide more infos, please tell me. Thanks in advance for enlighten me, Chris -- View this message in context: http://www.nabble.com/Servlet-Caching-tp18942690p18942690.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Re: Tomcat Newbie
If you can use the root application create a dev directory into ROOT or create a new context named dev Bye Luca -- From: "Mr Junior" <[EMAIL PROTECTED]> Sent: Thursday, July 31, 2008 9:45 PM To: Subject: [programmazione] Re: Tomcat Newbie I need dev to have its own context root. The only file I will have in /dev will be a redirect to the arsys webapp, so i don't need a totally new webapp. I just need to be able to have an http:///dev instead of http:///arsys/dev. Thanks Alessandro Ferrucci-3 wrote: This sounds like you're simply trying to deploy another webapp with the context root of /dev. Am I mistaken? or do you want to put a folder inside the arsys webapp called dev, but want dev to have its own context root? Please explain in more detail. -- Signed, Alessandro Ferrucci Does your webapps directory look like the following: On Thu, Jul 31, 2008 at 3:06 PM, Mr Junior <[EMAIL PROTECTED]> wrote: Hey all, i'm sort of new to Tomcat. I am trying to add a sub-folder to my website. Basically, I already have HTTP:///arsys. I want to add a HTTP:///dev. I found, in the conf/catalina that there was an arsys.xml that stated the path as /arsys, and told the installation path to the application. I can copy this, rename the path to /dev, and keep the website link the same, but then I don't have any control of the content of hte page. Going to http:///dev will just do the same thing that going to http:///arsys will do. I need to be able to drop in a different index.htm file in the /dev directory of my website so that I can control what content the users see. In IIS, I can create a folder to store this. I'm trying to figure out how to do this in Tomcat, but am not having very much luck. Any help is greatly appreciated! Thanks. -- View this message in context: http://www.nabble.com/Tomcat-Newbie-tp18761326p18761326.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Tomcat-Newbie-tp18761326p18762060.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Committing sendRedirect()
Maybe a solution could be to use AJAX client side to make the multiple requests. The client make the first request, when the server answers the client make the following request and so on. So the desired effect should be reached. Regards Luca -- From: "Tore Eriksson" <[EMAIL PROTECTED]> Sent: Tuesday, July 29, 2008 4:00 AM To: Subject: [programmazione] Committing sendRedirect() Hi everybody, I have a problem with redirects in Tomcat 5.5.25. I am doing a Lucene search and would like to send a redirect after finding the top 25 hits, commit this response, and then continue processing the remaining hits. The relevant parts of the doPost() code are as below: final int PARTIAL_HITS = 25; for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i); String citation = doc.get("citation"); /** Insert into table */ try { insertId.setInt(1, java.lang.Integer.parseInt(citation)); insertId.executeUpdate(); } catch (SQLException e) { out.sendError(500, "Bad SQL insert: " + e); } catch (Exception e) {} if (i == PARTIAL_HITS) { // Intermittant redirect out.sendRedirect(resultUrl); } } insertId.close(); if (!out.isCommitted()) { // Final redirect out.sendRedirect(resultUrl); } My problem is that the intermittant redirect is not committed until the function returns, which will take quite some time for some queries. I have tried HttpServletResponse.flushBuffer() and other possible variations. Any pointers would be most appreciated. Tore ___ Tore Eriksson [tore.eriksson ad po.rd.taisho.co.jp] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Embedding custom metadata in a jsp page; access generated Class via reflection?
I would use the Model-View-Control pattern. First it must be defined a Controller, which is simply Servlet mapped to catch all the request. This servlet can read the XML and append your metadata to the request and forward it to the correct jsp (which will handle your metadata i suppose) Regards Luca -- From: "Simon Kitching" <[EMAIL PROTECTED]> Sent: Tuesday, July 29, 2008 11:04 AM To: Subject: [programmazione] Embedding custom metadata in a jsp page; access generated Class via reflection? Hi, I need to associate some custom metadata with JSP pages, and access it *before* the page is rendered. The current implementation uses an xml with the same name as the jsp, eg foo.jsp foo.xml so that when I'm about to forward to "foo.jsp" I first look for a "foo.xml" file and if present parse it to extract the metadata. I'd really like to embed that metadata within the jsp page itself - but need access to that info *before* the jsp page executes. (a) Is it possible to obtain the name of the Class that is generated for a jsp, so that I could do introspection on it? It would then be possible to embed something like this into the page: <%! private static MyMetaData metaData = new MetaData(); public static MyMetaData getMetaData() { return metaData; } %> and look for/invoke the getMetaData method *before* forwarding to the page. Of course, this also requires that the servlet-class for the jsp has actually been generated. Is there a way to guarantee this is done for any particular jsp before actually doing a forward? Note that requiring pre-compilation of all jsps is not an option. This metadata stuff is needed for an open-source framework, and it is not reasonable to tell every possible user of this framework to precompile their jsps. (b) If the above is possible, is there a way to generate those static members from a custom JSP tag? It would be nicer to be able to do: and have that define the static members listed above. Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Thanks, Simon - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]