ANN: MVC conference in NYC next weekend.
Not this weekend, but next. Price is cheap - sign up, but goes up. This is also my last post on it. Today's NY Times Science has an ad on it. (Does anyone know the page #?). Here is the line up of sessions: 1. Ted Husted will present - on details of anew sample Struts application to be included. I hope he mentions future CoR. 2. iBatis.com home page has link to it, Clinton will present - flies in from BC-Canada's West coast. Also, new version jPetStore 4.0 is out with new version of SQL-Maps 2.0RC1, very popular for the model layer. Check it out! 3. Matt from Denver will present on updetable data grid jsp tag: http://demo.raibledesigns.com/appfuse/users-edit.jsp and Struts-Menu now reads from DB: http://demo.raibledesigns.com/appfuse/dynamicMenu.jsp. 4. Rod Johnson flies in from London: http://www.springframework.org, a modren MVC. He has some comments on EJB. 5. OpenSymphony WebWork 2 - Another MVC framework by Jason:: http://jroller.com/page/jcarreira/20040308#talking_and_not_talking_javaone 6. Christophe on RIA mXML: http://www.macromedia.com/devnet/flex/articles/struts.html . MacroMedia supported JSF early. 7. Vic on a Struts Portal Bring your books for an autograph, most of above have a book out. This is likely best one day seminar on the east cost (Maybe west coast too, JavaOne is for newbies and marketing types). .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Performace Improvement :: Struts based applications
Unit test the performance of the model layer. .V Satya Narayan Dash wrote: Hi, I am in the process of improving a struts based application. I am using the cache taglib (from apache) and have written some filters to improve the performace. I am using Apache2 as the web-sever and Tomcat4 as the servelt/jsp engine. I have optimized them both. But the peformance improvement is not substantial. Can you please give me some tips to improve the performance ? Need your help, Regards, Satya. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Database password
Best Practice is to follow the J2EE spec. The container provides services to the application, such as data source pool, declerative security, etc. In your container, create a data source pool. (Then access the pool via a DAO) .V Niall Pemberton wrote: I have to say I think putting it in the source code is the worst possible option. If for security reasons (say one of your developers leaves unhappily!) you need to change your database password, I don't think you want to have to change your java source, compile and re-deploy your app in order to achieve this. Its got to be better to have this as some kind of configuration parameter - you just have to make sure you protect the host's configuration properly. Niall - Original Message - From: Lucas Gonzalez [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 7:07 PM Subject: Re: [OT] Database password I believe that it will be easier to define a proper security policy in your production server than trying to hide the password or encrypt it. Another option is to hard-code it into your source, but you will loose some flexibility there. Hope that helps Lucas - Original Message - From: Guillermo Meyer [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 3:59 PM Subject: RE: [OT] Database password Users cant access this file, but the file can be accessed by people that is not from Information Security area (Seguridad Informática). The password shouldnt be known neither by the application deployer, nor the system administrator, but only by Information Security people. -Original Message- From: Lucas Gonzalez [mailto:[EMAIL PROTECTED] Sent: Jueves, 11 de Marzo de 2004 03:56 p.m. To: Struts Users Mailing List Subject: Re: [OT] Database password If the problem is the user accesing the plain text file by typing the URL in the browser... a better solution would be to tell apache to hide those files... - Original Message - From: Guillermo Meyer [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 3:49 PM Subject: [OT] Database password Hi: Our Struts application is currently in production. This applciation uses an Oracle Database (we are using DBCP from jakarta). We access this database through url, user a password and we need to hide the production database password. The password is stored in a configuration file and is in plain text. Have you got some best practices in this scenario? How are your Java Applications get connected to production databases and how is the database password protected? If we encrypt the password with 3DES, how should the key be protected? Cheers. Guillermo. NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To
Re: Reporting + Struts
Here is my jasper code: public void service( HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { //this servlet will take the parms and emit a report. // best used by fronting with a common of JSP that will pass in arguments to the report String rep = req.getParameter(rep); String args = req.getParameter(args); PrintWriter out = resp.getWriter(); if (rep == null) { out.println(no report argument); return; } ReportHelper helper = new ReportHelper(); rep = /WEB-INF/reports/ + rep; try { // ask helper to compile report //TODO: Copile only if changed String repXML = rep + .XML; helper.reportPrepare(repXML, this); // ask helper to fill report, enumerate the args, if any Map argm = new HashMap(); //null if no arguments exected by jasper's XML String repJasper = rep + .jasper; helper.reportFill(repJasper, this, argm); //emit String repOut = helper.reportEmitHTML(req); out.println(repOut); and ublic class ReportHelper { JasperDesign _des = null; JasperReport _rep = null; JasperPrint _prnt = null; // report ServletContext _ctx = null; private static Log log = LogFactory.getLog(ReportHelper.class); public void reportPrepare(String XMLfileLoc, HttpServlet serv) throws Exception { // pass in theservlet calling as this // read XML file log.debug(This should only happen in design mode); try { _ctx = serv.getServletConfig().getServletContext(); // get a handle to webapp/app String file = _ctx.getRealPath(XMLfileLoc); System.setProperty(org.xml.sax.driver, org.apache.xerces.parsers.SAXParser); System.setProperty(jasper.reports.compile.class.path, _ctx.getRealPath(/WEB-INF/lib/jasperreports.jar) + System.getProperty(path.separator) + _ctx.getRealPath(/WEB-INF/classes/)); _des = JasperManager.loadXmlDesign(file); String targetFile = _ctx.getRealPath(XMLfileLoc); targetFile = targetFile.substring(0, targetFile.length() - 4); // remove the xml ending targetFile = targetFile + .jasper; // save to a file JasperCompileManager.compileReportToFile(_des, targetFile); } catch (JRException e) { log.error(e); e.printStackTrace(); } }// reportPrepare public void sqlPrep(String spName) throws Exception { // execute a sql stored procedure that populates the work table, and prepares for output } public void sqlCleanUp(String spName) throws Exception { // execute a sql stored procedure that clears work table if needed } public void reportFill(String japerFileLoc, HttpServlet serv, Map parms) throws Exception { // execute the SQL, the slow part Connection conn = null; try { // cont _ctx = serv.getServletConfig().getServletContext(); // get a handle to webapp/app String repStr = _ctx.getRealPath(japerFileLoc); File jasperFile = new File(repStr); String repStr2 = jasperFile.getPath(); _rep = (JasperReport) JRLoader.loadObject(repStr2); conn = getConn(); _prnt = JasperManager.fillReport(_rep, parms, conn); } catch (Exception e) { log.error(e); e.printStackTrace(); }//catch finally { if (conn != null) conn.close(); // must free up connection. } }//reportFill public String reportEmitHTML(HttpServletRequest req) throws Exception { // output HTML default // if arg == PDF then // else HTML log.debug(reportEmit); String ret = null; try { Map imageMap = new HashMap(); req.getSession().setAttribute(REP_IMAGE_MAP, imageMap); JRHtmlExporter exp = new JRHtmlExporter(); StringBuffer sbuf = new StringBuffer(); exp.setParameter(JRExporterParameter.JASPER_PRINT, _prnt); exp.setParameter(JRExporterParameter.OUTPUT_STRING_BUFFER, sbuf); exp.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imageMap); exp.setParameter(JRHtmlExporterParameter.IMAGES_URI, ../rep/image?image=); exp.exportReport(); ret = sbuf.toString(); return ret; } catch (JRException e) { log.error(e); e.printStackTrace(); ret = e.getMessage(); return ret; } } // reportEmit public void reportSaveFile(Servlet serv) throws Exception { // JasperManager.printReportToPdfFile(_prnt, test.pdf);
Re: iBatis, displaytag, and 10,000 rows
That is bad design. You should querry the db and do TOP limit or a governor to prevent a run away qerry. If you do not find it... just re-run a better querry. .V Andy Engle wrote: Hi all, I am wondering if anybody has ever worked with a huge amount of data with iBatis and displaytag? I was showing off my little Struts application earlier to a buddy of mine here at work, and he asked if it would work well with 10,000 rows x 20-40 columns. Anybody ever worked with that much data with iBatis/displaytag before? If so, how did it work out for you? Thanks, Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Database locking and deadlock
Of course you could switch to a popular DAO such as iBatis or Hiberante and avoid the issue all together. There are JDBC forums on Sun. .V Shyam A wrote: Robert, Thanks for your response. No, the update queries use a single connection for which auto-commit is turned off. Commit is done only if all the update queries are successful. Thanks, Shyam --- Robert Taylor [EMAIL PROTECTED] wrote: Is it possible that dbConnection.doUpdate() gets a new connection each time which could possibly use up (exceed max allowed) the connections in the pool. Just a guess. robert -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 4:32 PM To: [EMAIL PROTECTED] Subject: [OT] Database locking and deadlock Hi, I know the subject of my mail is off-topic but I hope somebody will be able to help me out with my problem. I experienced a wierd problem today when a deadlock occured in my database - Oracle 9i, and it locked up all connections in the connection pool on my server - OC4J (Oracle 9iAS). I have a connection pool, which is configured on my server- OC4J. It is intialized on server startup, using a Servlet. I would like to verify if the code I use in my DAO may cause any deadlock condition. In my DAO, I use Update queries as part of a transaction. i.e, I turn off auto-commit, do my Update queries, and commit or rollback depending on the outcome of the queries. In one of the queries, I may need to update multiple rows of a table, and hence do the update operation in a loop (over a collection). Given below is the relevant portion of the code: snip //method that updates votes for candidates in an election public int updateVotes(BallotList ballotList) { int result=0; //result of insert operation String query=; Ballot ballot=null; CandidateList candList=null; Candidate candidate=null; int currVote=0; int electionNo = ballotList.getElectionNo(); try { for(int i=0;iballotList.getSize();i++) { ballot = ballotList.getBallot(i); candList = ballot.getCandidateList(); for(int j=0;jcandList.getSize();j++) { candidate = candList.getCandidate(j); //update votes for candidate if(candidate.getVote() 0) { //get current vote count and update currVote = getCurrentVote(electionNo,candidate.getPostNo(),candidate.getPidm()); currVote++; query = Update DZRCAND set DZRCAND_NUM_VOTE = +currVote+ + where DZRCAND_ELCTN_NO = +electionNo+ + and DZRCAND_POST_NO = +candidate.getPostNo()+ + and DZRCAND_CAND_PIDM = +candidate.getPidm()+; result += dbConnection.doUpdate(query); } } //end of inner for loop } //end of outer for loop } catch(Exception e) { System.out.println(Exception in DZRCAND update for votes: + e.getMessage()); System.out.println(query: + query); } return result; } /snip Is there a possibilty of a deadlock occuring in the above code when there are mutliple users concurrently accessing the system.i.e, multiple users update multiple rows of the table at the same time Could somebody throw some light on this? My understanding is that deadlocks are automatically handled by the DBMS. Anyway, is there a way to prevent the possiblity of deadlocks in my program ? One more thing - in the code above and in other Select queries, I open and close the Connection from the connection pool. However, I do not close the Statement or ResultSet objects. Will this lead to problems ? My understanding is that closing the Connection object will free up all the associated resources. Any help/pointers/suggestions will be greatly appreciated. Thanks, Shyam __ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com - 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] __ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com
Re: [OT] Database locking and deadlock
Is there a way you can reproduce this w/ iSQL command line? I assume Sybase, since you said row-level. My guess is that it's not the sql, but your DAO logic somehow. It would take you only a day or so to switch that one update to http://www.reumann.net/do/struts/ibatisLesson1 .V Shyam A wrote: Vic, Thanks for the pointer,but is there any way of salvaging the current situation?.It seems the Update operation is causing the DBMS to have row-level locks on the table,eventually leading to deadlock. Thanks, Shyam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Database locking and deadlock
Do you have a deadly embrace? Maybe just syncronise w/ semaphorse or the like. .V Shyam A wrote: Vic, Thanks again. I'm not in a position to switch to IBatis as my application is currently in use. Right now, I'm manually killing the user sessions which lock up the table in the database. My database is Oracle 9i, and this problem seems to occur only with large numbers of concurrent users. In my DAO,I update three tables as part of a transaction - table A and/or table B (in loops), and table C. Commit operation is done only after all tables are updated successfully. So, it may be possible that the DBMS locks up rows of table A or B (before commit) and waits until it updates table C for the commit. Is this the cause of the problem? I've not been able to determine (using SQl Plus, TOAD ) which query is causing the row-level lock. Any ideas? Thanks, Shyam --- Vic Cekvenich [EMAIL PROTECTED] wrote: Is there a way you can reproduce this w/ iSQL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ann: North East Conference on MVC Frameworks and Struts in 3 weeks:
Most people already know what MVC is, once you know what it is, here is the next step. Presenting will be the popular frameworks and components in use by 8 speakers: -Ted Husted Author Struts Chains/2.0 the dominant framework in use, from Ziff Davis, to Apple Store to most large commercial sites. Husted.com -Rod Johnson Author EJB/Spring springFrameWork.com -Christophe Coenraets Flex-MacroMedia - back to rich UI w/SOA (Great blog entry on Struts + Flex) markMe.com/cc -Howard Lewis Ship Author HiveMind (SOA, IOC, AOP) commonly referred to as the next big thing javaTapestry.blogspot.com -Clinton Begin DAO/iBatis/SQLMaps the best DAO layer imo, used by Spring, jPetStore, basicPortal, etc. -Matt Raible Author displayTag/strutsMenu (displayTag is my favorite J2EE component) Raibledesigns.com -Jason Carreira WebWork 2 freeroller.net/page/jCarreira - Vic Cekvenich Author basicPortal (J2EZ easy and simple to customize application for membership, portal, cms, community, store, etc. using bestPractices for large, profitable commercial sites. ) + more You will get a CD mailed to you once you register. April 3rd from 8AM to 7PM in NYC at nyhotel.com, next to MSG. Advertised in JDJ, NY Times, etc. My guess is that you wont find half as many good sessions at Suns Java One. It $99 to register now at baseBeans.com, in a few day's price keeps going up. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ann: North East Conference on MVC Frameworks and Struts in 3 weeks:
Corrections: - Flex and WebWork2 speakers added. This will cover major MVC choices. - Ted Husted, senior Struts Committer, walks through a new version of the original Struts example, updated to take advantage of the latest features in Struts 1.2 and accepted best practices. .V Vic Cekvenich wrote: Most people already know what MVC is, once you know what it is, here is the next step. Presenting will be the popular frameworks and components in use by 8 speakers: -Ted Husted Author Struts Chains/2.0 the dominant framework in use, from Ziff Davis, to Apple Store to most large commercial sites. Husted.com -Rod Johnson Author EJB/Spring springFrameWork.com -Christophe Coenraets Flex-MacroMedia - back to rich UI w/SOA (Great blog entry on Struts + Flex) markMe.com/cc -Howard Lewis Ship Author HiveMind (SOA, IOC, AOP) commonly referred to as the next big thing javaTapestry.blogspot.com -Clinton Begin DAO/iBatis/SQLMaps the best DAO layer imo, used by Spring, jPetStore, basicPortal, etc. -Matt Raible Author displayTag/strutsMenu (displayTag is my favorite J2EE component) Raibledesigns.com -Jason Carreira WebWork 2 freeroller.net/page/jCarreira - Vic Cekvenich Author basicPortal (J2EZ easy and simple to customize application for membership, portal, cms, community, store, etc. using bestPractices for large, profitable commercial sites. ) + more You will get a CD mailed to you once you register. April 3rd from 8AM to 7PM in NYC at nyhotel.com, next to MSG. Advertised in JDJ, NY Times, etc. My guess is that you wont find half as many good sessions at Suns Java One. It $99 to register now at baseBeans.com, in a few day's price keeps going up. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)
-Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] 4. I had the same frustrations that you have. I made the decision that the best way to restore the balance of good in the universe, was to try to become the kind of tech lead that I would have wanted when I was a newbie/humble grunt. +1 .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem moving a form page into tiles
I have a page with a form that works on it's own, I can submit and will take me to the next page corrctly. However, I am trying to forward to a tile definition now and my submit will cause a null pointer exception and doesn't seem to find my bean in session. can anyone tell me what i'm doing wrong? does the tile pageScope have something to do with this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RE: Orkut (read what the original message said)
Yes, please no more FLAME on Orkut, my bad. I am not adding anyone anymore, there are 43 people in Struts group on Orkut. and it a FOAF... Friend of a Friend type, so people that are connected will get in other ways, I just wanted a seed... One of the things that is a minus of this list is a lot of OT... my bad! .V Andrew Hill wrote: Actually the message just said to mail Vic. Since mailing Vic and mailing the list are not mutually exclusive activities, your assertion that the message said not to mail the list is incorrect. Indeed since Vic reads messages posted to the list, a message to the list is a message to Vic. (and also a msg to a few thousand others who dont care - or in my case havent a clue what the message is even about!). ;- -Original Message- From: Peter Abbot [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 09:29 To: Struts Users Mailing List Subject: [OT] RE: Orkut (read what the original message said) Cant people read, it said email Vic NOT the email list! l commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Orkut - Done!
I invited the people so far... and I am done. I will not invite more! I hope they add others after this post, so the people I added can add others. Please upload your photo or avatar and join the Struts club so we can see you. Over time, I will put some cool things there in Orkut Struts club . very cool (like a Struts Portal or a Sturts sofware for writing your own socail network w/ rich UI... better than Orkut; or almost free conference w/ Husted, Raible, Begin + more, or a big Stuts surprise) .V [EMAIL PROTECTED] wrote: Hey Vic... anyway you could invite me as well??! tks! sebastian S e b a s t i e n T r e m b l a y 01 - Cryptographic Security (613) 991-8394 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Sunday, February 08, 2004 11:16 PM To: [EMAIL PROTECTED] Subject: Orkut If you want to join Struts in Orkut Social Network send me an e-mail saying so. .V (if you do not know what it is don't worry) - 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: [OT] Re: Debugging JSP
James Mitchell wrote: - if you rely on JSP debugging, chances are good that you have WAY too much logic in your pages. Consider following an MVC approach. +1 .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Orkut
If you want to join Struts in Orkut Social Network send me an e-mail saying so. .V (if you do not know what it is don't worry) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Orkut
Done. Find the Struts community on there and join. Now you add others :-) .V Ramachandran wrote: Yes I want to join. -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich Sent: Monday, February 09, 2004 9:46 AM To: [EMAIL PROTECTED] Subject: Orkut If you want to join Struts in Orkut Social Network send me an e-mail saying so. .V (if you do not know what it is don't worry) - 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: Ann: East Coast Advanced MVC Seminar: 7 Speakers
19 people signed up so far. Cool. Price goes up tmrw. .V Vic Cekvenich wrote: At nyhotel.com on April 3rd, convenient by train from Boston, NJ, Philly and DC. 1 day early registration rate at baseBeans.com now! Price will go to $495 and up as the date approaches, and there are limited seats in the booked room. As advertised in upcoming Feb. issue of JDJ. (scroll down to see the JDJ Ad as it will appear) You can get advanced Struts sessions without going to JavaOne. Visit NYC in Spring. After registration, you will receive a CD of conference materials, before the conference. Speakers presenting live: Husted, Raible, Begin, Canter, Cekvenich, Lewis-Ship, Johnson Bring your questions! More information coming... but you can lock the rate now. .V ps: Q:What happened to baseBeans site? A.My HD crashed, it will take me a while to fix. pps: Q:Is there any more info on the seminar available now? A: Not yet. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ann: East Coast Advanced MVC Seminar: 7 Speakers
At nyhotel.com on April 3rd, convenient by train from Boston, NJ, Philly and DC. 1 day early registration rate at baseBeans.com now! Price will go to $495 and up as the date approaches, and there are limited seats in the booked room. As advertised in upcoming Feb. issue of JDJ. (scroll down to see the JDJ Ad as it will appear) You can get advanced Struts sessions without going to JavaOne. Visit NYC in Spring. After registration, you will receive a CD of conference materials, before the conference. Speakers presenting live: Husted, Raible, Begin, Canter, Cekvenich, Lewis-Ship, Johnson Bring your questions! More information coming... but you can lock the rate now. .V ps: Q:What happened to baseBeans site? A.My HD crashed, it will take me a while to fix. pps: Q:Is there any more info on the seminar available now? A: Not yet. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: Help wanted in SF
http://www.craigslist.org/sfc/eng/22118807.html (pardon me, but I help the list sometimes and sometimes I milk it) .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reducing JSP Testing Time
[EMAIL PROTECTED] wrote: Do you have any recommendation for reducing this testing time for Web pages that include JSP tags ? Im using Eclipse for coding JSPs (I mean here HTML pages that include JSP tags, no tag libraries). In order to test the visual aspects of my JSPs, I then build a war archive and deploy it to my web container. Nothing original here. Above is what I do when I tag a CVS release about once a week. But.. for day to day devlopment, I edit JSP and actions live. I point my Resin and Tomcat configuration for document root to where my eclipse project files are, which are structured in a war like directories. As soon as I change a JSP I can refresh a page and see it. As soon as I change a anction or a formbean, I can refresh the page in Resin and see it. (Tomcat has a Eclipse plug in, but requires a restart and a patch to server.xml not to complain about session formbeans, which takes about 5 seconds as opposed to Resin, which is instant. Just saving in Eclipse auto compiles and Resin can tell a class file changed, and reloads the class). .the testing time is rather long. And I really get fed up with this now. Before I even start development, I make sure that ALL the forms (html pages) reports and outputs are mocked up in HTML. (no need to start writing formbean before we know what the client wants). Once that is done, I just write struts mappings to those html files, and a simple action and a formbean (since now I know the proerites) so I have a prototype based on the mock up. Note how I have the UI done 1st before construction. The UI developers can use any HTML tool they like. FrontPage, DreamWeaver, Vi I do not care, but I do know once they mock it up I can make it a prototype. *I just don't code utill I have requirments. * Since there is a mock up and a prototype, changes to formbeans and actions are minimal, the navigation is lready decided by the client. And last phase is DAO, which is not a problem, I can do any SQL join they want to see. (Some people code backwards, they look at data they have in tables, and they show those records to the client. How this aproach ties into requirments I have no idea, so client makes them go back to mess with each page over and over. Why they just don't use a formBean for what it's meant for- and interface- I have no idea. See- formal training helps.) Therefore Im wondering f there is a ** magic ** tool that would allow me to code a web page that includes JSP tags in a VISUAL environment (like MS FrontPage does for HTML for instance). The idea here would be to be able to include JSP tags in a VISUAL manner (such as a html:text for instance) in order to actually seeA CODING TIME the result on the screen BEFORE actual deployment in the container. Does such a tool exist ? Camino, M7, ExaStruts Studio, etc. Most are linked of the baseBeans cheat sheet page (but I am in the middle of redoing the site). But... I think Java developers like me, should do Java, and let UI developers use any UI tool they like. I do not know fonts, collors, spaceing, etc. .V Fred - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
.NET: We are just like Struts... only better.
Just like everyone else. http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-aspnet-j2ee-struts.asp This was fun to read, it puts a smile on my face. Somone has a chip on their sholder. * Main point made in there: Do not use JDBC, you make us look bad, use an auto caching DAO (data caching in data layer, get it). Clients I see in real life do, but some people on this list dont use a DAO and do caching in layers other than Model. * Struts framework is ... many of its key components have been absorbed into the main J2EE framework. - not one! CommonsBeans? CommonsCollections? CommonsValidator? Tiles? Action? FormBean? It's a community of users, not a vendor thing. I do not think they get it. They think Sun does Struts? Look MS.There is no vendor. It' called open source. If Sun shuts down... it will have no impact on the market (for example jRockit JVM, one of 6 VM's I know - http://www.j2eegeek.com/blog/archives/2003_09_01_j2eegeek_archive.html#106336646351242237 ) Save session state to db... I hope no one here does that (but I do think that if .Net suggests for them to do it, GREAT) Version is a strength of .Net? Have you ever had .DLL hell? OK, I do not think the author knows that J2EE comes with built in JAAS and... it's declerative role based security. Struts and other tags uses Servlets (since 2.2, go read JavaDoc) Role based API. Again, I do not think the Author is familiar with localization in Java... for example JSTL's localization. Again... on testing, I happen to use OpenSta that runs circles. I think he is implying that I can't test in J2EE. The benefit of MVC layers is that you can test each layer. PageController is an MVC? Looks a lot like MV... with a small c. This is commic: How to migrate Struts to ASP. ?? That is what I want to do, get propiratory with a Vendor, who want's choice? You know, clients no longer say should I use .Net or Struts, topic just does not come up for large projects. Oh, does it run on the largest comercial platform, Linux? I do my development on Linux, w/Eclipse and Tomcat and pgSQL. but, every 3 months, I reformat my windows machinee and re-install XP. I do not do this with Linux(Fedora)... and I guess my new OSX is BSD, but I have had it less than 3 months. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validations - 'format' vs 'business'
Guido García Bernardo wrote: I really think that is a good aproach. At least one of the most simple and centralized. Thanks, I take a lot of time to try to KISS. ...from a pure struts point of view someone can think that your solution is mixing the model with the view. I think ActionForm should remains as part of the view, or just a 'box' between the view and the controller. What do you think? This is what I do as well when bus. rules are complex, so it's applied as well, not just theory, by just ovreding the Sturts API validate(). I call the supper vlidate and capture the messages, and then to it I append my custom messages as follows: Then I can create a new MyBusRuleHelperClassForMyXYZFormBean: MyBusRuleHelperClassForMyXYZFormBean rulz = new MyBusRuleHelperClassForMyXYZFormBean() messages rulz= rulz.check(this.getCollection()); // or what ever you want to send in as data of the bean to the bus rule validator. return messages; So the action calls validate() on formbean and get messages to put in scope. But...formBean validate() delegates the work outside of the formbean, in the bus. rules clayer. That object often creates its own DAOs. This also makes it very easy to unit test bus. rules outside of the container. On the other hand, I _must_ expose business logic as a API for other projects. With this fact in mind, business methods should be implemented doing validations again (defensive programming, you need to think about possible errors from your users and don't assume anything...). HOW without duplicated code? So your MyBASERuleHelperClass may be an interface or have an abstract base. It should not import any Servlet or Struts jars. If you want to go nuts, you can even use a rule engine in the bus. rules layer as long as it's fast. Since my bus rules relie on a fast self caching dao... I have no issues, but I test w/ OpenSTA anyway. .V Thank you again, Guido García Bernardo Vic Cekvenich wrote: {repost} I just override validate() method on formbean and do all there, including super.validate() that reads validation.xml. In here I call DAO's to do business validation also, ex: what is the available credit for the client to place this order. Then in action I do this: errors = formbean.validate(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Example of a non-threadsafe Action?
Fyi, the infonoia.com Struts class in Geneva's (w/ Cedric the tiles creator) students get a book the covers how to get around this the right way! See the Wolfgang post. .V Sgarlata Matt wrote: OK, I understand now. That makes sense. Thanks for your help, Craig Richard! Matt - Original Message - From: Yee, Richard K,,DMDCWEST [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 3:37 PM Subject: RE: Example of a non-threadsafe Action? Matt, A final declaration just means that the reference can't be changed to a different SimpleDateFormat instance. A static declaration just means that there is one instance of the variable for all of the instances of the class. Neither modifier affects how the SimpleDateFormat uses internal instance variables. -Richard -Original Message- From: Sgarlata Matt [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 11:40 AM To: Struts Users Mailing List Subject: Re: Example of a non-threadsafe Action? What if the SimpleDateFormat variable is declared as final and/or static? Thanks, Matt - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Nifty Music [EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 2:35 PM Subject: RE: Example of a non-threadsafe Action? Quoting Nifty Music [EMAIL PROTECTED]: Thanks Craig! You certainly confirmed my suspicions, although I would have guessed that I could've gotten away with sharing the SimpleDateFormat variable since it wouldn't depend on any values coming in from request objects. Could you perhaps shed some light on why it wouldn't make sense to share it? Because the internal implementation of SimpleDateFormat uses instance variables during parsing and formatting, so it's not thread safe :-). Craig - 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]
Re: How find DataSource?
I put mine in a static block of the base DAO. (static as in once per class, and all DAO's extend my base DAO). .V e-denton Java Programmer wrote: Merry Christmas, Wow, I finally connected to my data source! Now, I want to put the code somewhere it will be executed only once, and save the DataSource object where Actions, beans, etc. can get at it. That way, I don't have to perform the lookup all the time. Any suggestions on where to put the one time setup code, and where to save the DataSource object reference (in the application?). Thanks again, Will - Original Message - From: Vic Cekvenich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 20, 2003 12:14 PM Subject: Re: How find DataSource? See sample source code section here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html Ex: Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); DataSource ds = (DataSource)ctx.lookup( java:comp/env/jdbc/TestDB); Of course what you do with the data source depends on your DAO implementataion (iBatis, Hibrenate, etc.) .V hylepc wrote: Hi, From a Data Acess Object (DAO), I need to access a DataSource (like getServletContext().getAttribute (Globals.DATA_SOURCE_KEY)). But, I don't have access to the servlet variable. What is the proper way to get the DataSource from a DAO which is called by an Action but doesn't extend Action? Thanks, Will - 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: How find DataSource?
repost (news error?) Martin Gainty wrote: how about putting it into DynaActionForm::initialize which initialises the beans anyhow.. -Martin A DAO in a form or a bean hmmm. If that is what you want to do in an MVC framework. I don't do data source in formbeans. Take a peak at PetStore 3 on ibatis. (even Spring uses that as MVC example, but not w/ Struts) .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validations - 'format' vs 'business'
{repost} I just override validate() method on formbean and do all there, including super.validate() that reads validation.xml. In here I call DAO's to do business validation also, ex: what is the available credit for the client to place this order. Then in action I do this: errors = formbean.validate(); hth, .V Guido García Bernardo wrote: Hi, I have a design doubt... I must validate data coming from a form. This consist typically of: - 'format' validations (i.e. a field is not empty or it is numeric) that I do in the validate method of the ActionForm - 'business' validations that usually require a DB access I actually do 2 steps (actions) per operation. One of them prepare the data and the second one does the operation itself. And here comes my first question: ¿¿is there any other better aproach?? Maybe something similar to a Tiles Controller to prepare the data... class PreOperationAction extends Action { public ... execute ( ... ) { // Create JavaBeans to populate html selects and several inputs (requires DB access) and include them in the request // Forward to error/success jsp } } class PostOperationAction extends Action { public ... execute ( ... ) { // Get data from ActionForm // Business validations (the selected values and inputs are valid from the business point of view) // Execute business logic (encapsulated in external business logic classes) // Forward to error/success jsp } } At this point I don't know what is better (from a MVC perspective). 1. Do it as actually, that is, doing business validation before business logic. This way I think I can't expose the business logic as an API or as a web service. 2. Include all the validations (business and format) into the business logic classes. This way I must duplicate format validations 3. Doing a OperationValidations class (? only a vague idea) 4. Is there any pattern or any best practice related? Does Validator Plugin allow complex business validations? Finally, I need your opinion about handling validation errors: 1. Throwing an Exception from the business logic classes and catch it in the Action (or declare the exception in struts-config.xml) 2. Returning null (or -1, or a no-sense value) from the business logic classes 3. Any other way... Thank you very much, Guido García Bernardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Example of a non-threadsafe Action?
Example of what not to do: public SomeActtion extend Action { Object _someObject; public execute (.. ) { ... bla bla _someObject.setSomething(); ... bla bla } David Erickson wrote: Hey I have been reading a lot about threading lately from the JLS and otherwise.. but my question is what would be an example of a non-threadsafe action? Struts manual said that only one instance of an action exists in the JVM.. and when I run an action each thread creates its own versions of all the variables within the action correct? So assuming I'm not accessing some outside 'global' variable, everything is inherintly threadsafe right? If anyone can give me an example of what 'not' to do that would help tremendously. thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How find DataSource?
e-denton Java Programmer wrote: Has anyone set up a connection pool using web.xml? Steps? Examples? Tips? No one has, it can't be done. You can declare it in web.xml, that's all. Read Rick Reumans tutorial on ibatis dao and ibatis petstore 3 example and do that, and you will be in a good place. It's sad, no books on this. All JDBC books talk about JDBC 1.0, not about JDBC 3 pooleddatasource, or DAO. Vic, I might have two problems with keeping it in a static block. 1. My container can be passivated, so everything must be serializable. Passivation is not a good idea ever, so just ignore it. Change the co-lo or host if you have to. It sure does not give scalability to the host or to app. hth, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How find DataSource?
See sample source code section here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html Ex: Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); DataSource ds = (DataSource)ctx.lookup( java:comp/env/jdbc/TestDB); Of course what you do with the data source depends on your DAO implementataion (iBatis, Hibrenate, etc.) .V hylepc wrote: Hi, From a Data Acess Object (DAO), I need to access a DataSource (like getServletContext().getAttribute (Globals.DATA_SOURCE_KEY)). But, I don't have access to the servlet variable. What is the proper way to get the DataSource from a DAO which is called by an Action but doesn't extend Action? Thanks, Will - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enhancement Request or Possible Alternative?
I have a commercial Struts product that includes an event that is generated when a new action is called. I built it so that one can clean up any session stuff when going to another action for large projects. We could work out something VERY reasonable. .V Hookom, Jacob wrote: We are doing a lot of module switching or multistep workflows (which we handle fine through session beans) but at the same time, users are allowed to jump to different pages and we would like to capture a leave event when they aren't within a set of mapping(s). I'm wondering if anyone has solved this problem because it would also allow for constraints on workflows at the action level (if you leave pages X,Y,Z then fire Action 'CheckSession'). Jacob Hookom Senior Programmer/Analyst McKesson Medical-Surgical Golden Valley, MN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enhancement Request or Possible Alternative?
Hookom, Jacob wrote: Vic, I did notice that there is pattern matching now available on the CVS head, but I was wondering if your solution was done with Struts as is, or if you had to make modifications to the Struts Config DTD and/or RequestProcessor? The solution of using a workflow to enforce pathways is not desired since we want to leave that flexibility in most cases and have the business layer resolved with changes of context (finishing/creating). -Jake It's based on extending Struts Action class. It does not enforce anything, it just calls a method (onNewAction) that gets called on old action when you call a new action. So if no code there for a certain action, it does nothing. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Flash Flex w/ Struts article
http://www.macromedia.com/devnet/flex/articles/struts.html Is this for real? YES! Point of Struts is MVC, so some people do JSP, Velocity... other do Hibrenate or iBatis... one thing remains. (note how they did not support Spring, or WebWork or XYZ). Flex is XML like, used to be Royale ( and my guess the product that resulted when MacroMedia rummored to break of from JSF). (This is diffrent than PetStore http://blueprints.macromedia.com , I also realy like the Components from Flash Pro 2004 such as Tree, Grid, Calendar that bind to any SOAP like source) If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of loads UI rendering to each client thus giving scalability! If you are bidding projects, and your bid shows clients the richer UI, guess who wins the gig? And it's Struts, something you know. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flash Flex w/ Struts article
I usually show the Flash PetStore, but there are dozens of Flash Data Entery applications out there. I am a MacroMedia parter, and I could get you more links, but check out the Flash PetStore first (from http://blueprints.macromedia.com ) and then if you want more, let me know. (the only VERY anoying thing is the they like to show the splash page, which makes me sick, but then they show the app. ) I plan to conver to Flash as View but it will take me at least months to get the current workload done. .V Daniel Joshua wrote: is there a sample Flash Flex w/ Strut application on the web? currious what a RIA looks like... Regards, Daniel -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich Sent: Wednesday, 17 December, 2003 3:07 PM To: [EMAIL PROTECTED] Subject: Flash Flex w/ Struts article http://www.macromedia.com/devnet/flex/articles/struts.html Is this for real? YES! Point of Struts is MVC, so some people do JSP, Velocity... other do Hibrenate or iBatis... one thing remains. (note how they did not support Spring, or WebWork or XYZ). Flex is XML like, used to be Royale ( and my guess the product that resulted when MacroMedia rummored to break of from JSF). (This is diffrent than PetStore http://blueprints.macromedia.com , I also realy like the Components from Flash Pro 2004 such as Tree, Grid, Calendar that bind to any SOAP like source) If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of loads UI rendering to each client thus giving scalability! If you are bidding projects, and your bid shows clients the richer UI, guess who wins the gig? And it's Struts, something you know. .V - 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: Chain Was: Flash Flex w/ Struts article
BaTien Duong wrote: Yes. This is what I am looking at Struts 2 of request/response framework (struts-chain): in the article example of registration service, we will probably have something like this: Registration request - RequestProcessor - RegistrationService - RegistrationAction - blah blah blah - ResponseProcessor - Selected Presentation engine - user response As long as Chains are used for technology and not for business application workflow, great. I think it be a missues to do workflow, that some people will try to use it for that. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT: Strategy for out of date items through forms using hibernate?
I avoid timestamps. Just make your where class = to the selct cluase. In case any colum is changed, it fails. (if you really need this) .V David Erickson wrote: Hi I am using Struts with Hibernate in a webapplication.. we are using forms etc. The problem I am currently trying to decide how to handle is thus: Assume user 1 loads up an object in a form and is modifying it. Assume user 2 loads up the same object in a form and is also modifying it. User 1 submits the modified object. User 2 also submits the object, however his is out of date and I would like the webapp to tell him that and show the differences that exist. What is the best way to use hibernate to deal with this? What I have attempted is using the built in timestamp feature in MySQL, I have a field in my object that is timestamp but does not insert or update, thus mysql controls its value. Then when the user submits the object I loaded another copy of that object from the DB and tried to compare their dates.. however this gave me an error saying: net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 1, of class: cmcflex.salesweb.model.prospect.Prospect because of the object I loaded to compare. What do do? Is there a better strategy for tackling this? I tried using the actual timestamp in the properties for my object, but then when I tried to submit the object the generated sql said when id=? AND timestamp=? meaning it would not update if the timestamp is different, and I'm unsure if I could even determine if it did or did not update. Thanks in advance, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: iBatis DAO + Hibernate?
I would use Ibatis or Hibrenate as a DAO, not both. iBatis lets you use any SQL(corelated self join, sooner or later you will need to do a trick or tune performance), which is why I have been using it with much success; and I teach Struts with it, and there are other Struts/iBatis resources. It is ER based. Hibrenate used to be more popular before iBatis and it is more OR (which I make a minus since I work with rows of columns, for example with DisplayTag). Either will server you very well, they are both great. (bad things IMO are JDO, EJB, JDBC) .V David Erickson wrote: We're needing to roll out DAO and ORM in our webapp... been evaluating hibernate and it looks awesome, but we'd like to insulate our app from that, has anyone tried using iBatis' DAO layer then plugging hibernate underneath that? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: iBatis DAO + Hibernate?
I have not use OJB, so ... how much is it worth my opinion if I did not use it. Maybe people that used it can say a word relative to other DAO's. I did look at OJB, and it seamed heavy. I like light weigh. (like Sturts is light weight). iBatis I realy like. my 2c. .V Pedro Salgado wrote: What do you think about OJB? Pedro Salgado On 16/12/2003 16:58, Vic Cekvenich [EMAIL PROTECTED] wrote: I would use Ibatis or Hibrenate as a DAO, not both. iBatis lets you use any SQL(corelated self join, sooner or later you will need to do a trick or tune performance), which is why I have been using it with much success; and I teach Struts with it, and there are other Struts/iBatis resources. It is ER based. Hibrenate used to be more popular before iBatis and it is more OR (which I make a minus since I work with rows of columns, for example with DisplayTag). Either will server you very well, they are both great. (bad things IMO are JDO, EJB, JDBC) .V David Erickson wrote: We're needing to roll out DAO and ORM in our webapp... been evaluating hibernate and it looks awesome, but we'd like to insulate our app from that, has anyone tried using iBatis' DAO layer then plugging hibernate underneath that? -David - 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: [OT] Struts vs. XYZ
That feature does sound neat. I know of other exaples where good code did not make it in. HOWEVER... a strength of Struts IS the DEVELOPER COMMUNITY support and interactivty. No other framework comes close to the developer culture relative to this Struts, for example this mail list. It's also OK to be simple and not heavy. It does everything you need and does not get in the way when you need to do something it was not designed to do. There are a dozen frameworks out there... they all start by saying :We are better than Struts becuase ... The point is that Struts is the most popular framework out there by far. Like how many books do they have on XYZ framework? How many people ofer training on it? If you get on a project... chances are it's Struts. So knowing Spring or 20 other things out there will not help you. Struts + DAO looks good on a resume. Else you have to explain what it is. 6 developers who all have 6 different things better than Struts. I look as Struts (using Churchill's words) like this: It is the worst framework except for every other one out there. I find Struts to be the simplest framework to use, you just have to dispatch in action, and if you need to work on someone else's code, take a peak at Struts.config, and you know where the M,V and C is. Struts will not fail you project, it is production proven. .V Struts Trainer baseBeans.com ps: I think JSF is far behind a lot of other frameworks in features/benefits, and I will document specifics why only a newbie would use JSF, once it ships. Gus Heck wrote: Interesting, I'm not sure I agree, but the patch that he complains about not being added sounds useful... Robert Taylor wrote: A coworker sent me this link and said it was an interesting read. http://today.java.net/pub/a/today/2003/12/11/mvc.html?page=1 Personally I don't think the author put much research into Struts before writing this article which has some interesting points and history about MVC, but basically is written to support his new ground breaking Shocks Servlet Framework. robert - 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: Struts EL status
Yes, I would say BEAN and LOGIC tags should not be used! One should use JSTL, DisplayTag, Struts Menu, HTML-el, Tiles-el. AFAIK EL will become main (and others deprecated) when Struts drops support for Tomcat 3, which is planed for Struts 2.0. I do think everyone is using EL and if they are not, it's a mistake (or they are on Tomcat 3. I am on Tomcat 5 and Resin 3 since they came out) .V Mike Duffy wrote: IMHO: Using the Struts HTML-EL tags with JSTL is the best way to go. The Struts Logic tags are not as funtional as JSTL. Mike --- Derek Clarkson [EMAIL PROTECTED] wrote: Hi all, My boss doesn't want to use Struts EL because as he puts it it's not part of the main development and we can't tell where it might go. Can anyone clarify when and if it is going to take over ? everyone seems to be using it and I've used it in two projects (which didn't make my boss happy!) -- Regards, Derek Clarkson .O. Analyst/Programmer ..O Waterwerks Pty Ltd OOO Melbourne, Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What goes where?
I would say JDBC drivers should not be in the WAR file (WEB-INF/lib) but should go to container. I am wondering, why would you not use a DAO, for my own reasons, since there are questions on user list regarding JDBC, when I think DAO should be used (unless people using DAO just have no problems) and not JDBC; like why would once decide to use JDBC? (vs SQL based DAO like iBatis for example; but any DAO is much better than JDBC). .V Eric SCHULTZ wrote: Good afternoon... I've looked around this list a bit and read the web sites (Tomcat, Struts) and I know a bit about class loaders, but I'm still perplexed. The blank Struts 1.1 app WEB-INF/lib has a bunch of jar files in, some overlap with Tomcat 4.1.27's common/lib directory (namely the commons libraries collections, dbcp, logging, and pool). This leaves commons digester, fileupload, lang, and validator uniquely in the WEB-INF/lib, along with struts.jar, struts-legacy.jar, and jakarta-oro.jar. As I understand struts.jar needs to remain in the WEB-INF/lib directory; I assume struts-legacy.jar should stay there too. But can all my commons jars go in the common/lib directory? Should those not already in common/lib go in shared/lib? I realise some people advocate putting everything the app needs in its WEB-INF/lib directory; and I agree with that if I have version dependancies, but I don't. And I already have to put my JDBC drivers in common/lib to use Tomcat's JNDI datasources so I've already started down that path. Thanks. Eric Schultz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: designing simple scheduler
With a layered MVC application you can re-use beans outside of Struts. Have cron call beans application. I do. .V Raman wrote: Hello, I am using struts/beans in my application. I want a scheduler kind of thing that after regular interval of time should check the db and send mails. I want some suggestions regarding running it on red hat linux and way to go for this. Cheers, Raman Garg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and Commons Chain
This is very interesting I think. .V Hookom, Jacob wrote: I was looking at chain's implementation, instead of executing the commands with the visitor pattern, wouldn't a more powerful/flexible method be to implement it using a filter pattern? See: http://java.sun.com/blueprints/corej2eepatterns/Patterns/InterceptingFilter. html Sample Chain: CommandServletStart CommandExceptionHandler CommandStoreState CommandExceptionThrower -- CommandStart.execute(Context ctx, Chain chain) throws Exception { ServletContext srvCtx = (ServletContext) ctx; String usrId = srvCtx.getRequestScope().getParameter(id)); String newName = srvCtx.getRequestScope().getParameter(name)); // get user and save state User user = SomeService.getUser(usrId); String oldName = user.getName(); // set new state and execute try { user.setName(newName); ctx.setAttribute(user, user); chain.executeNext(ctx); } catch (Exception e) { // on error, rollback change user.setName(oldName); throw e; } } -- CommandExceptionHandler.execute(Context ctx, Chain chain) throws Exception { try { chain.executeNext(ctx); } catch (SQLException e) { chain.executeNext(ctx); } // let unhandled exceptions go up } CommandExceptionThrower.execute(Context ctx, Chain chain) throws Exception { throw new SQLException(); } With this, you would not have to change your inheritance to add behavior (going from a command to a filter). The given command would already know best on how to handle itself and since it calls the next item in the chain, we can also wrap the context to take care of situations where we want to have listener type behavior. The chain could also allow for runtime manipulation by the commands, to insert additional commands to handle errors. chain.insert(SomeCommand).insert(AnotherCommand).executeNext(ctx); Jacob Hookom Senior Programmer/Analyst McKesson Medical-Surgical Golden Valley, MN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: designing simple scheduler
Turansky, Mark wrote: how to reuse beans? You should be making your beans without any thought of the web whatsoever. THEN your Actions can calls your beans. This way, the Actions are clients of your API. By having an API containing business logic (instead of business logic in your actions), you promote reuse. An additional benefit of this type of bean design is that you can test it automatedly (JUnit!) without having Tomcat or servlet container running. The Action, in this case, is the glue connecting all your business logic (beans). Replace the glue with another type of glue and you can reuse your business components anywhere. +1 You should be making your beans without any thought of the web whatsoever An additional benefit of this type of bean design is that you can test it +1 And to underline the obvios Struts is MVC implementation. The benefit of MVC is MVC layers. Then you can call your application (Yes, you can write console applications in Java, and re-use your Mail beans ) like this in bsh: while true do $JAVA_HOME/bin/java -classpath $CLASSPATH com.async.run sleep 100 done Else... you did not do MVC Struts... oops. hth, .V -Original Message- From: Voinea, Marina [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 9:19 AM To: 'Struts Users Mailing List' Subject: RE: designing simple scheduler Vic, can you please explain a bit more how do you reuse your beans ? (and have cron job call yor application - you know the idea of separating layers, how is your architecture like now ?) (we would need something similar...) Thanks, M. -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 6:29 AM To: [EMAIL PROTECTED] Subject: Re: designing simple scheduler With a layered MVC application you can re-use beans outside of Struts. Have cron call beans application. I do. .V Raman wrote: Hello, I am using struts/beans in my application. I want a scheduler kind of thing that after regular interval of time should check the db and send mails. I want some suggestions regarding running it on red hat linux and way to go for this. Cheers, Raman Garg - 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]
Re: designing simple scheduler
No, no that is not what we are saying. Just call the beans from your UI. In this case your UI is console. Same bean that you allready tested. Struts is the fastest way to develop that I know (15 years of IT for me) So your console app check the JavaMail and saves it or send it from db. Same beans and DB struts uses. So any mail shows up online. Batch/async is bread and butter of DP. Online is just the icing. .V Voinea, Marina wrote: yes, calling APP layer API (beans) from the UI is OK. I was thinking if it is possible the other way around : to somehow inform the UI that soemthing happened on the backend and it has to display a message accordingly. (kind of polling from UI to back end). The APP layer bean triggering an event in UI application. Coud this be done? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts User Roles
Struts users Servlets Role for it's tags, etc. This snipet is from WEB.XMl (and not Struts.xml): security-constraint web-resource-collection web-resource-nameSecure/web-resource-name url-pattern/do/loginPg/*/url-pattern url-pattern/do/newsBlgCmntAddPg/*/url-pattern url-pattern/do/userChngPg/*/url-pattern /web-resource-collection auth-constraint role-nameVALID/role-name role-nameENHANCED/role-name role-nameGUEST/role-name role-nameEXPIRED/role-name role-nameADMIN/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/sLogin/login.jsp/form-login-page form-error-page/sLogin/loginBad.jsp/form-error-page /form-login-config /login-config Here is a link on more WEB.XML (that works on any J2EE container -such as Tomcat): http://e-docs.bea.com/wls/docs70/webapp/web_xml.html .V Tiago Henrique Costa Rodrigues Alves wrote: Where can I find Struts Roles documentation? Tiago Henrique C. R. Alves - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HELP: about to get datasource of struts and pass to logic bea ns...
Ah a small comment... The Struts DataSource should not be used, I agree; the J2EE container DataSource should be used; but it will not be removed for a while AFIAK. (Deprecated just means it might be removed in some futre version. Just like hopefully bean, logic and html:link get deprecated in 2.0 in favor of JSTL. It's just a nudge from developers (of which I am not one) for you to start considering the better alternatives. I even think Java should deprecate Connection , ResultSet and java.util.Date in favor of DataSource, RowSet and Calendar) Poolman is very, very nice... I used it before 2001; when I switched to RowSet (before I started using a SQL based DAO). DAO is best thing to do now, and all the DB issues would disapper. .V Edgar P Dollin wrote: Don't spend the time to get DataSource working. It is deprecated and will be removed from struts in 1.2. I use Poolman at sourceforge (I highly reccomend it for non-j2ee projects). Most others use the DataSource supplied with the container. Edgar -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 4:29 PM To: Struts Users Mailing List Subject: Re: HELP: about to get datasource of struts and pass to logic beans... There are lots of classes involved. I will give you an example: 1. my LogonAction calls EditorService.java (business delegate) 2. EditorService.java calls MySQLEditorDAO.java (data access object implements EditorDAO.java, which is a data access interface) 3. the MySQLEditorDAO.java returns EditorBean.java (a Java bean with three properties) Here is my LogonAction.java: package org.apache.artimus.logon; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.artimus.lang.Tokens; public final class LogonAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws java.lang.Exception { // Obtain username and password from web tier String username = ((LogonForm) form).getUsername(); String password = ((LogonForm) form).getPassword(); EditorService service = new EditorService(); EditorBean editor = service.findEditorData( username ); HttpSession session = request.getSession(); session.setAttribute( editor, editor ); // Log this event, if appropriate if (servlet.getDebug() = Tokens.DEBUG) { StringBuffer message = new StringBuffer(LogonAction: User '); message.append(username); message.append(' logged on in session ); message.append(session.getId()); servlet.log(message.toString()); } // Return success return (mapping.findForward(Tokens.VALID)); } } // End LogonAction Here is the EditorService.java: package org.apache.artimus.logon; import org.apache.artimus.logon.dao.*; public class EditorService { EditorDAO ed = new MySQLEditorDAO(); public EditorBean findEditorData( String username ) { return ed.findEditor( username ); } } Here is the EditorDAO.java: package org.apache.artimus.logon.dao; import org.apache.artimus.logon.EditorBean; import org.apache.artimus.logon.exceptions.EditorDAOSysException; public interface EditorDAO.java { public EditorBean findEditor( String username ) throws EditorDAOSysException; } Here is the MySQLEditorDAO.java: package org.apache.artimus.logon.dao; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; import org.apache.artimus.logon.EditorBean; import org.apache.artimus.logon.exceptions.EditorDAOSysException; import org.apache.artimus.ConnectionPool.DBConnection; public class MySQLEditorDAO implements EditorDAO { // Here the return type is EditorBean public EditorBean findEditor( String username ) throws EditorDAOSysException { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { conn = DBConnection.getDBConnection(); stmt = conn.createStatement(); String query = SELECT user_role, journal_category FROM members WHERE user_name = ' + username + '; rs = stmt.executeQuery( query ); if (rs.next()) { return new EditorBean( username, rs.getString( user_role ), rs.getString(
Re: HELP: about to get datasource of struts and pass to logic beans...
Take a look at a very good db example app that uses Struts on iBatis.com caled PetStore 3. .V Ricky wrote: hi, there, with my project i had several queries about get datasource in struts. i know how to get datasource in struts, just as in myAction, use getDataSource method and return DataSource object, and go on to get connection i also know the logic beans between the Controller and Module, so i create a logic bean ,i don't know how to get datasourc of pass the datasource, in some tutorial , i got a way to solve this, create a method getDAO(HttpServletRequest request) and pass the request to the method to get DataSource, i was lost here, i dont' know what should i return in getDAO, should i return a DataSource object or others and in my logic bean i can use the datasource and also get connection , statement and resultset object , there i have to close it after i finish my process what do you think of this i did ? in general, when i got a DataSource, i will got a connection from datasource and a PrepareStatement and also a ResultSet , when i finished my process, i can close all object i opened before in final method of try ...catch...experession.. now what should i do to return a proper object in getDAO method and in logic beans i can use the object to process logic business... i appologized for this ... i hope you can give me some suggestion or flow.. thanx! now here is my flow of struts framework to pass the datasource to the logic beans... i hope you can reword if you have some good idea...of correct my mistake... :) myAction : myAction extends Action() { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LogicBean bean = new LogicBean(); Object objcet = bean.doMethod(getDAO(request), other param) } public DataSource getDAO(HttpServletRequest request) { DataSource ds = null; ds = getDataSource(request); return ds; } } and in my logic bean : class LogicBean { public Objct doMethod(DataSource ds, other param) { try { Connection conn = ds.getConnection(); PrepareStatment stmt = conn.prepareStatment(SELECT ...); stmt.setInt(1,); ResultSet rs = stmt.executeQuery(); return Object.; } catch (SQLException ex) { ex.printStactTrace(); } final { try { rs.close(); stmt.close(); conn.close() } catch (Exception ex) { ex.printStactTrace(); } } return null; } } should i pass the DataSource to my logic beans? otherwise what object should i pass - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RE: Is it required to restart weblogic everytime after compiling ?? ? Need help Desperately .. :-(
Wendy Smoak wrote: and restarting this weblogic again and again each time i debug .. :-( ... stil waiting for a solution ... Trim your posts! Not only was it off topic, it was 400 lines long. How about doing your development work on Tomcat, then deploying to Weblogic? This has the added advantage of forcing you to write code that'll run on any container. + 1. Or Resin, the both have a plug in to run w/ Eclipse so you set in even. In general, propriatory code is inferior. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disadvantages of Struts?
I disagree with you as well Robert. Having a confgiration nudges you toward design and separation, and everyone on the team know where to find things. In fact, when not doing Web apps, I use HiveMind, just so that I can have the structure. Anyway, there a lot of MVC compeitoris. .V Robert H. Tran wrote: My point was not against configuration altogether, but rather against the current rigid and centralized configuration. There should be options. If there is configurations in a component, it should be self-contained by the component. It is no framework's business. If there is an api in Struts, this can be done nice and easy, as I said with Eclipse. - Robert. - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 11:51 AM Subject: Re: Disadvantages of Struts? Robert H. Tran [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think an action's mapping is a decision by the action itself. Like I said earlier, when an application development finishes, that decision will become static. At that point, when an Action's mapping changes, its code will have to change too (unless the new mapping is kind of a synonym to the old mapping, which doesn't bear any shift in the semantics). As such, there is almost no point in keeping the decision and the code separate (i.e. making the decision's configuration a loose end of the code). Or at least, configuration shouldn't be the only way to add or modify an Action. I disagree with this almost completely. If actions are written properly, you should be able to reconfigure the application, to some extent at least, by changing the config alone and not touching the Java code. This is immensely useful when an app needs to be customised after the fact, and when the source code is not available (e.g. by a customer, in their own environment). -- Martin Cooper Even though each Action's configuration may be small, the configurations for all the Actions need to be kept track of and maintained (for integrity). That may be a significant but unnecessary side work. To view the mappings, there can be a tool to traverse the structure by api calls and display it. That can be done after the fact and doesn't have to be before it. In addition to that, when the decision (or configuration if any) goes where the code lives, modularity increases. IMHO, - Robert. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 6:55 AM Subject: RE: Disadvantages of Struts? I have to disagree with you on the first point. I find that there is just a small amount of necessary configuration required to build an Action class (most of my Action configurations have about a half dozen lines, even less if there is no associated ActionForm). I'm not really sure what you mean by paddle back and forth between the code and the configuration, could you explain? Thanks. Robert H. Tran wrote: I am not sure that is true. Struts seems to lack of an API. IMO, there are more required configurations than necessary. Take Action for example, to write an Action, one has to paddle back and forth between the code and the configuration. It is like an executable having to configure each of its dlls. The visibility of the mappings is nice to have but the mappings can be generated after the fact as in a debugging view. When the application is finished, configurations become static. But since configurations are required, they will be like loose ends of the application. Another issue: how can one componentize his code and deploy it in a self-contained plug-in, as with Eclipse? Please forgive my novice. - Robert. - Original Message - From: Rick Hightower [EMAIL PROTECTED] To: 'Struts Developers List' [EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 6:24 PM Subject: RE: Disadvantages of Struts? Don't be silly. Struts is perfect. -Original Message- From: Robert H. Tran [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 2:10 PM To: Struts Developers List Subject: Disadvantages of Struts? I just wonder if Struts comes with any significant drawback. I mean not in terms of when to use Struts and when not to use it necessarily, but more in the line of anyone's wishes that it had been better. Any advice is very appreciated. -- -- - 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]
Re: Database with struts
I disagree. DataSource should not be used, you should use a DAO, for example iBatis.com. .V Gurpreet Dhanoa wrote: hi You have to Configure DataSource and then u can get the refernce of the same it in the ACtion and can use it Regards gary - Original Message - From: Divya B Sridhar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 7:03 PM Subject: Database with struts Hi all, I am trying to do a database connectivity using struts. Actually, the database resides on another machine and I have tomcat running on my local machine. The other machine is a linux box(a linux machine) which has the database installed(PostgreSQL). So, apart from the data-sources tags to be specified in the struts-config.xml file, the Action class containing the Connection and the queries, what other configuration is required. Any ideas on this?(I mean to ask the other steps required in order that a simple sample database example with struts works - drivers etc. Any input is welcome) Thanks in advance, Regards, Divya. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Subclassing ActionServlet
Errr. request processor might be upgraded in version 2.0 of Struts.. so I subclass Action. .V Fullam, Jonathan wrote: All, I need to check the Session for an authenticated user before most requests. To do this I subclassed ActionServlet and only call super(request, response) upon verification that authenticated user is in the Session. if (request.getRequestURI().endsWith(welcome.do) | request.getRequestURI().endsWith(logon.do) | request.getRequestURI().endsWith(html)) { super.process(request, response); } else if (request.getSession().getAttribute(USER) == null) { //Forward to login page response.sendRedirect(/welcome.do); } I also know about the ability to subclass the RequestProcessor and providing my own implementation of the processPreprocess method to accomplish the same thing. Does anybody know of any serious disadvantages or side effects of subclassing the ActionServlet class rather than the RequestProcessor class. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT:Re: connection pooling issue
This is not a Struts question IMO. here is a FAQ for Wiki: #1. No one should use connection pool, if you want for some (I can't think of a good one myself) do low level JDBC, you should use data source. You can look up the data source via JNDI. Things like (low level) RowSet take a data source as argument... don't worry about connections, you will mess them up, unless you a double nested finnaly block. #2. If you use Struts... you should also use a DAO, such as iBatis.com. So use a data source (not connections) via JNDI and... don't use data source, use a DAO. .V Ajay Kalidindi wrote: Hi The issue is: 1. I restart tomcat, everything works good with tomcat, struts, connection pool ... I monitered the catalina.out log and all looks good connecting/releasing etc. 2. After few hours I get the following error : java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream I have already tried changing autocommit to true in struts-config.xml. Any suggestions are welcome. Env Info : Redhat 9, Tomcat 4.1.29, struts 1.1, jdk 1.3 ... Regards Ajay Kalidindi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advantages of Struts?
FAQ #2: I would say this about Struts: Sturts is like a kindergarden, we put our boots here, our books here; thus they allow people to know where to find things on a project. Presnetation here, Data Layer here; And also people know generaly what they should be doing: Once you have a form (html) mock up, you know what the formbean should be (it mapps). Just get the form bean to CRUD via DAO. Also a few consider dynambeans a bad practice. http://sixlegs.com/blog/java/death-to-dynabeans.html I consier them a not as good as form beans, they are harder to unit test among other things. .V McClung, Brian wrote: Robert, I've gone to the opposite extreme as you. I don't want the action to be responsible for where it goes, only for telling users which forward states it supports. I've removed the forward from both the Action and the struts-config.xml file. The action still returns the forward, but the forward is dynamically created based on what the page has passed to the action. In my situation I resorted to this because I was using a single action to handle multiple applications on the same site. This meant that my path would not be the same between each application. Resorting to multiple mappings in the configuration file would rapidly get out of control for me as some of these applications can be created and removed rather quickly. I do have separate pages per application and this is why the page drives the actions result. I know this bends the MVC pattern, but it allows me to concentrate on developing actions, form beans, and all the back end business logic, while letting the Creative Designers develop pages and GUI workflow. Is anyone else doing something similar? I posted my DynaAction class that I use to do this with a couple of weeks ago. It really surprises me that there hasn't been a greater need for something like this in the community. I'd be curious to hear how others have solved this problem. Brian McClung Senior Programmer Belo Interactive 214-977-4083 -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 2:18 PM To: [EMAIL PROTECTED] Subject: Re: Disadvantages of Struts? I disagree with you as well Robert. Having a confgiration nudges you toward design and separation, and everyone on the team know where to find things. In fact, when not doing Web apps, I use HiveMind, just so that I can have the structure. Anyway, there a lot of MVC compeitoris. .V Robert H. Tran wrote: My point was not against configuration altogether, but rather against the current rigid and centralized configuration. There should be options. If there is configurations in a component, it should be self-contained by the component. It is no framework's business. If there is an api in Struts, this can be done nice and easy, as I said with Eclipse. - Robert. - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 11:51 AM Subject: Re: Disadvantages of Struts? Robert H. Tran [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think an action's mapping is a decision by the action itself. Like I said earlier, when an application development finishes, that decision will become static. At that point, when an Action's mapping changes, its code will have to change too (unless the new mapping is kind of a synonym to the old mapping, which doesn't bear any shift in the semantics). As such, there is almost no point in keeping the decision and the code separate (i.e. making the decision's configuration a loose end of the code). Or at least, configuration shouldn't be the only way to add or modify an Action. I disagree with this almost completely. If actions are written properly, you should be able to reconfigure the application, to some extent at least, by changing the config alone and not touching the Java code. This is immensely useful when an app needs to be customised after the fact, and when the source code is not available (e.g. by a customer, in their own environment). -- Martin Cooper Even though each Action's configuration may be small, the configurations for all the Actions need to be kept track of and maintained (for integrity). That may be a significant but unnecessary side work. To view the mappings, there can be a tool to traverse the structure by api calls and display it. That can be done after the fact and doesn't have to be before it. In addition to that, when the decision (or configuration if any) goes where the code lives, modularity increases. IMHO, - Robert. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 6:55 AM Subject: RE: Disadvantages of Struts? I have to disagree with you on the first point. I find that there is just a small amount of necessary configuration required to build an Action class (most of my Action configurations have about a half dozen lines, even less
Re: Tab Layout in Struts !!
I use it with tiles! Just the top tile is the menu. (Ex: tab1, option 1: goto /do/action1) configured with CSS for look and feel. So a simple menu 1st, and then you wil see tabs as no big deal. .V Wendy Smoak wrote: Vic wrote: Struts Menu does tabs (and trees) much better, example of a tab: http://www.raibledesigns.com/struts-menu This looks great, but I'm currently using Tiles. What would be involved in switching? I know nothing about Velocity, would that replace the Tiles definitions? For the OP... I tried to use the tiles-example's tabsLayout but have a problem. You've said what you want, but not what you've tried that didn't work. Can you post your current tiles-defs and struts-config so we can see what might be wrong? * when click on the ADMIN tab, it will show the ADMIN contents if and only if it has logoned, otherwise, it will show the login page. (both of the login page or the admin page are belongs to the ADMIN tab, so that the TAB selection is ADMIN) AFAIK you can't conditionally switch which Tile you want-- if you're using tiles-defs, then you define the tabs in advance. What you can do is have the contents of the tab, the JSP, display one thing or the other based on however you're deciding if someone is logged in. So your admin.jsp might have: c:if test=${user.loggedIn} display some stuff /c:if c:if test=${not user.loggedIn} display some different stuff /c:if (or use choose/when/otherwise instead of the two ifs, or use logic:equal if you prefer the Struts tags.) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling issue
Just becuase Struts has something, does not mean you use all of it, just the main part. For example bean create is not MVC, the point of action is to pre poplate the bean, also better done with c:out. For example the way you are trying to is deprecated. The create a data source pool and JNDI name in Tomcat like this: Context path= docBase=/wheremywaris/ debug=0 reloadable=false crossContext=true Logger className=org.apache.catalina.logger.SystemOutLogger verbosity=4 timestamp=true/ Resource name=my_jndi_name auth=Container type=javax.sql.DataSource/ ResourceParams name=bppool parameternameurl/name valuejdbc:postgresql://localhost:5432/bp?autoReconnect=true/value /parameter parameter namefactory/namevalueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueorg.postgresql.Driver/value /parameter parameter namemaxIdle/name value3/value /parameter parameter nameusername/name valuedbuser/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value10/value /parameter parameter namepassword/name valuechangeme/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value20/value/parameter /ResourceParams /Context Or like this in resin: database jndi-namejdbc/db-pool/jndi-name driver type=org.postgresql.jdbc3.Jdbc3ConnectionPool userbpuser/user passwordchangeme/password serverNamelocalhost/serverName databaseNamedpname/databaseName /driver max-connections3/max-connections /database Add this to you web.xml: resource-ref res-ref-namedppool/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Then select a DAO (Hibrenate or iBatis) For ibatis create a name such as this ibatis data source (based on JDNI data source: datasource name = ids factory-class=com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory default = true property name=DBInitialContext value= java:comp/env / property name=DBLookup value= dppool / /datasource Then in your code you can do something like this: _daoMap.setCurrentDataSourceName(ids); List rows = _daoMap.executeQueryForList(dao_map_name, parmList); This is real easy to unit test for CRUD. You can then have a formbean map to rows list. See how Struts makes you data agnoist, it's just a collection. And you can deploy same war against production db or staging db, without re-compiling the war, thus what you test is what you use. Of course, display tag takes list as an argument once place in request scope. In actrion you pre populate the bean, and ... display tag gets it in scope. rant There are many web sites about doing this in detail, and many J2EE books Some cosnider J2EE a pre-requesite for Struts. (Another faq is servlet's api on user roles, Servlets api is used by Struts and others for seucirty. For some reasone people have home grow exotic security. If you do strange things... no one can help you, you are not on the main road. Else somone else can tell you the deprecated way to do this for JDBC 1.0 users. That way is... as you noticed buggy and not suitable for large production sites. I wonder why JDBC users don't just use Servlets and Tomcat features, and use Struts. If you use Struts, you should use DAO, else do everything low level. You know there are people that do Struts training and mentoring, some have used Struts since 2001. It's very cost effective, and some are looking for gigs. I am done preaching for the day.. almost: Do not use data source within Struts. Do use a DAO via JNDI! rant/ .V Ajay Kalidindi wrote: Hi Vic, data-sources data-source key=contact set-property property=autoCommit value=true/ set-property property=description value=Mysql Contacts/ set-property property=driverClass value=com.mysql.jdbc.Driver/ set-property property=maxCount value=5/ set-property property=minCount value=2/ set-property property=password value=password/ set-property property=url value=jdbc:mysql://localhost:3306/db/ set-property property=user value=user/ /data-source /data-sources above section in struts-config.xml is provided as part of struts to enable DB connection pooling. Also it works perfect for few hours. I forgot to mention my database, it is mysql. Regards Ajay Kalidindi -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 3:04 PM To: [EMAIL PROTECTED] Subject: OT:Re: connection pooling issue This is not a Struts question IMO. here is a FAQ for Wiki: #1. No one should use connection pool, if you want for some (I can't think of a good one myself) do low level JDBC, you should use data source. You can look up the data source via JNDI. Things
Re: Advantages of Struts?
Maybe in old days of client server, people used to ship Oracle and MS SQL drivers for ODBC. Boy, that was not fun, so people learned. Yeah, OCI and ctlib, good ridance. In J2EE, the container provides services. (As per any J2EE book). JNDI, DataSourcePool, Security, etc. etc. So no need to have JDBC related jars in war file. Newbies don't use these services, but re-implement a home grown exiotic and buggy versions. (Sometimes that is good, becuase I used to make money by just fixing connection leaks) A pro just uses the J2EE services that are debuged and working allready. They do this for exactly the same reason you said. In order to do less configuration. If emplyees is removed, and security is LDAP or JDBC realms or what ever, no impact on the war file. If the DataSource needs to be changed to have a database fail over, no need to change the war file, or bother the developers. The unix admin just changes the xml file. Or deploy war file from stageing to production, no changes. You can even change containers from Tomcat to Resin... and not change the WAR file. The is modular. Any scaling of data source pooling is a container toonable. This has nothing to do with Struts, this is J2EE container services. You do not have to use them, you can write your own security (that tags do not then see) or your own buggy connection pooling thing from JDBC 1.0. Sturts is data layer agnostic, that's all. If you go out of the way to lock it... you can, no sign will pop up, the code will compile. But you are not on a main road, and not many people will help you (unless you pay hourly) If you remvoe a jar file, you need to regression test. Are you suggesting that the Unix admin un-tars (nzips) the war file to get to the jar files for some good reason? Untill you leverage J2EE container services, you will have stability issues, scalability issues, modular issues, etc. (maybe write your own socket server? ) I know the fault. People have OLD jdbcs books, where the hello exaple is how to write a connection pool. This was OK in '95 and '96 when we used AWT. But things have advanced a bit since then. Also, you will gain huge producitivity by using a DAO... which all realy on container services. But again... this is a J2EE discussion, not Struts. Like if you used Spring, or WebWork, or Tapestry, or Sofia or ... Same thing. Use a DAO! Use container services provided for you for free and working. If the conatiner does not give you good scallability or is to messed up... you can pick another (again J2EE options) .V Robert H. Tran wrote: Point taken. But there is an option to modularize (and scale too), which is currently missing. It's like adding (or removing) an employee phone number at a firm usually doesn't mean having to update the listing at the phone company, especially not by the employee himself going to the phone company to do that. Yet the employee's phone can still be found and served up. That's the job of the firm. It should be self-contained under the firm's management to interface with the phone company through some protocols. Any one firm added or removed shouldn't incur changes to the phone company's configuration. A more practical example is: I want to remove this one jar file that contains one (possibly multiple) independent unit(s) of many actions and pages, what entries in Struts's configuration file do I need to remove? The other option allows me to just remove the jar file (or a corresponding directory) worry-free. - Robert. - Original Message - From: Vic Cekvenich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 3:20 PM Subject: Re: Advantages of Struts? FAQ #2: I would say this about Struts: Sturts is like a kindergarden, we put our boots here, our books here; thus they allow people to know where to find things on a project. Presnetation here, Data Layer here; And also people know generaly what they should be doing: Once you have a form (html) mock up, you know what the formbean should be (it mapps). Just get the form bean to CRUD via DAO. Also a few consider dynambeans a bad practice. http://sixlegs.com/blog/java/death-to-dynabeans.html I consier them a not as good as form beans, they are harder to unit test among other things. .V McClung, Brian wrote: Robert, I've gone to the opposite extreme as you. I don't want the action to be responsible for where it goes, only for telling users which forward states it supports. I've removed the forward from both the Action and the struts-config.xml file. The action still returns the forward, but the forward is dynamically created based on what the page has passed to the action. In my situation I resorted to this because I was using a single action to handle multiple applications on the same site. This meant that my path would not be the same between each application. Resorting to multiple mappings in the configuration file would rapidly get out of control for me as some
Re: White Space
Consider Tidy from W3.org or jTidy on sf.net for html clean up. .V Derek Clarkson wrote: My thoughts exactly, I just don't know where and how to do this. ;-) On Friday 05 December 2003 11:27, Wendy Smoak wrote: Derek Clarkson wrote: Is there anyway to automatically remove white space blank lines and tabs, but still leave normal lines in place so i can read the html if necessary. I.e. remove any occurances of the following: 1. Empty lines including those just filled with tabs. 2. All other tabs. 3. Trailing white space. Sounds like a job for a Filter! You'd modify the HTML after it leaves the Struts webapp, before it leaves the container on its way to the browser. I suspect someone has written this already... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
data connections issues - solution
http://www.reumann.net/do/struts/ibatisLesson1 (among others) .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] Struts Menu 2.0 Released!
It's in the navigator package. (but no need for CVS, you can just use the jar and look at the war example). .V snpe wrote: Hello, Is it Struts Menu 2.0 in CVS for Struts Menu ? I checkout HEAD and RELEASE_NOTES have only 1.3 version regards Haris Peco On Monday 01 December 2003 11:07 am, Matt Raible wrote: This release is a significant refactoring of the 1.x codebase. The source and site is now built using Maven. Menus can now be defined using Velocity templates and support has been added for looking up dynamic values. This means that if you have ${variableName} in your menu-config.xml (in a link), the tag library will look in all scopes for a variable with the name variableName. The example app has been updated to improve documentation. IMO, the Velocity templates is huge because it means if it's possible with HTML - it's possible with Struts Menu. Changes (http://struts-menu.sourceforge.net/changes-report.html): - Renamed package structure to net.sf.navigator. - Added support for using Struts' actions and forwards for links in menu-config.xml. - Added support for using dynamic variables in menu-config.xml. - Updated build process to use Maven for building/deploying. - Refactored to use Velocity and allow dynamic variable substitution. Read the nitty-gritty details about the Velocity enhancements at http://raibledesigns.com/wiki/Wiki.jsp?page=StrutsMenu. Demo: http://raibledesigns.com/struts-menu Download: http://tinyurl.com/x6p9 Enjoy! Matt - 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: [OT] initialization of application-wide drop-down settings
What I do is do data (Model) caching the data layer, the DAO, such as iBatis. For example I can set the cache for options to 24 hours or more, thus no special code for caching otside of DAO. Then I retrive optionsCollection from DAO order by some_sort_colum_for_order. This puts them in order. The data is accessed once for the application context ('cuase of DAO). hth, .V Haroon Rafique wrote: Hi, Long time lurker, first time poster. I'm using struts 1.1. My question is rather general and may even be off-topic. I use a ServletContextListener class for populating certain application-wide settings inside the contextInitialized() method. One of the requirements is that I need to maintain the order of the drop-down values. Might need to separate them by locale at a future stage as well. So, for example my phone types collection looks as follows: // set up list of phone types Collection col = new ArrayList(); // FIXME: read from a properties resource bundle instead col.add(new LabelValueBean(Business Tel., B)); col.add(new LabelValueBean(Cell Phone,C)); col.add(new LabelValueBean(Pager, D)); col.add(new LabelValueBean(Fax - Mailing (local) address, F)); col.add(new LabelValueBean(Fax - Permanent (home) address, G)); col.add(new LabelValueBean(Fax - Business,H)); // place under PHONE_TYPE_KEY in application scope servletContext.setAttribute(Constants.PHONE_TYPE_KEY, col); Later on, in my view, I can use the html:options tag to populate the drop-down. Hah! I used html:options in the previous sentence, so that makes this post partially on-topic. So, far so good, as this is only development. In production, I'm really supposed to get these values and labels from a database. It is acceptable to only load this once upon application startup as is the case now by using ServletContextListener. Making the call to the database upon application startup is not an option, however, a cron job is able to pull these values out and store them in a file. Now my question to you is what is the most convenient file structure which will let me meet my above-stated requirements? So, far I have thought of (and discounted): 1. ResourceBundle (since it will not keep the original order) Likely candidates are: 1. custom code to read a .properties file which maintains the order (something along the lines of using getResourceAsStream() - have to think about locales). 2. Use Digester to read XML data (have to think about locales). I'm pretty certain some of you must have run into this problem beforehand. Can I call upon your experience to provide me with some input or point out something obvious that I may have missed? Cheers, -- Haroon Rafique [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts menu
Just today a new version of Struts Menu was released, that is what I use. .V Francesco Di Candia wrote: Hi all, i'm a Struts newbie and i'm trying to move my web-application from JSP/Servlets to Struts/Tiles. Someone of you can suggest my the best way to implement menu tile using Struts Tiles togheter? I need real experience mixing Struts Tiles because I found something googling but real experience are better. Thanks in advance, Francesco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Composing parts of a form with tiles
From home page of Struts you can get to Tiles API here: http://jakarta.apache.org/struts/userGuide/struts-tiles.html#insert See the role option? That will optional display or not display a tile. There are many variations on role with other tags. .V Mohan Radhakrishnan wrote: Hi, We need to show a set of buttons at the bottom of a form activated or deactivated according to the role of the login user. Now the html:form closes after the set of buttons in the page. How are parts of the same page composed like this ? Help appreciated. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chain - not comatible
(thanks Batien for emailing the war). When runing Struts Chain example I get a Sepecified RequestProcessor is not compatible with TilesRequestProcessor. Is there a work arround? (Tiles and tilesaction are VERY important to my designs) .V (I am still just looking at examples.. still not sure how to write a hello world chain) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: security pattern
Here is what I do in WEB-XML: security-constraint web-resource-collection web-resource-nameSecure/web-resource-name url-pattern/do/pageA/*/url-pattern /web-resource-collection auth-constraint role-nameRoleBA/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint security-constraint web-resource-collection web-resource-nameSecure/web-resource-name url-pattern/do/pageB/*/url-pattern /web-resource-collection auth-constraint role-nameRoleB/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/sLogin/login.jsp/form-login-page form-error-page/sLogin/loginBad.jsp/form-error-page /form-login-config /login-config hth, .V Vano Beridze wrote: Thank you for the answers. I will be more specific. I now have the following implementation. It's not built with struts, but is built merely from servlets. The application consists of a login page,main page and also bunch of other pages. when a user wants to do something it chooses one menu item from the main page, navigates through some pages and at the end is returned to the main page. ( I think it's the usual scenario for many web apps). The menu items are called actions. So I have a list of actions. Each action defines the role (It's the Oracle Database role) that a user (Oracle user) must have to access that action. I also define which page is owned by which action. What that means. For example. If I have a menu. Edit | |---Station |---Country And I press on a Station link I might visit the following pages Station1,Station2 and so on. I say that Station1,Station2 is owned by Station action. It's important to say that Station1 can be visited from another action. When a user is logged in I determine what actions it has based on his role and presenting him only that menu items. But if a user is clever he can bypass this limitation and type directly the link to another page that he is forbidden to access to. I have a filter that is applied to all the servlets. This filter does the following job. It checks the user session. Extracts the actions that the user has. Determines what page user is trying to access. Determines the action this page is owned by and checks if the user has that action. That's all. It's working fine. The only difficulty is that I need to track the relation between actions and pages during development. My question is the following: Is there a better pattern that I can use and If yes Can you provide me with more info? How can jaas help me in this situation? Thank you very much. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-chain
I tried to build to get the chain sample app... and I can't. I got the common and struts chain jars built. In order to build sample chains war... you have to get sturts to build from source... which requires you get commons-lib.home of CVS of jakarta commons and sandobox... yuck. (Maven build of Sturts is broken). If anyone (Batjen?) wants to e-mail me privetly the example war file great, tia. .V Craig R. McClanahan wrote: Quoting Vic Cekvenich [EMAIL PROTECTED]: BaTien Duong wrote: i am able to have struts-chain example (the old struts-example with struts-chain built from cvs) up and running using j2sdk1.4.2_02 and tomcat 5.0.14. Where did you find an example of using a Struts chain? .V Download the jakarta-struts nightly source distro (or check it out from anonymous CVS). Then, start Tomcat and execute: cd contrib/struts-chain ant install This builds a variation on the standard struts-example webapp that uses the chain-based replacement for the standard RequestProcessor. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tab Layout in Struts !!
Struts Menu does tabs (and trees) much better, example of a tab: http://www.raibledesigns.com/struts-menu Eric Chow wrote: Hello, I tried to use the tiles-example's tabsLayout but have a problem. There are two TAB in my web page, HOME and ADMIN. I want to implement as following: * when click on the ADMIN tab, it will show the ADMIN contents if and only if it has logoned, otherwise, it will show the login page. (both of the login page or the admin page are belongs to the ADMIN tab, so that the TAB selection is ADMIN) How can I define this in tiles-def.xml and struts-config.xml? And solution to implement this? Please give me a hand ! Eric == If you know what you are doing, it is not called RESEARCH! == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Server manged vs. struts managed db pools
Edgar P Dollin wrote: There is another issue regarding connection pooling in struts vs connection pooling in the container. In struts the war file contains all the information the app needs to run. With container pooling (at least with tomcat and resin) you have to coordinate the container configuration with struts configuration. With a single container running multiple apps this is a bit of an issue. Edgar I have that same example. The war has JNDI. How the connection pool is provided is of no issue for the war. It works great. You can just lean on J2EE and let it take you home. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Good reporting engine/tools
I used to use Crystal and now use ireports.sf.net with JasperReports Butt, Dudley wrote: Hi all, Has anyone used any good reporting stuff recently? Please let me know. We're currently evaluating to get rid of our Crystal reports, just need to know some other options...THANX NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Stress Test
OpenSTA works for me. Jerry Jalenak wrote: Hi All, I've got a problem with my current web app where it stops responding after about 6 hours. I need to set up a test environment and simulate multiple logon's so I can trap my way through the code and figure out where it is failing. I think there is a tool available that can be used to do this - HTTPerf (I think), but I'm not sure if this will do what I want. Does anyone have any experience with this? Thanks. Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: STURT set up and IDE for STURT
Did you read any of the Struts books or tutorials on the home page of Struts? .V Meenakshi Dhawale wrote: Hi, I am new to STURTS architecture I have told to implement it for live project. So I have downloaded STURTS 1.1 from http://mirror.ehpg.net/apache/jakarta/struts/binaries/jakarta-struts-1.1.zip Now I want to make set up for the same. So can u please guide me with this regards. Like what are the pre-requisites s/w for making STURTS setup or any installation mannual. I have used Forte and ecliplse as IDE. Whether i can continue with these? If yes...what setting I have to make? If no .. which is preferred IDE... regards, Meenakshi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Lazy questions on this list
Larry Meadors wrote: What is JSTL? kinds of questions should be answered SNIP As long as these questions are answered, they will continue to be asked. +1 Maybe a FAQ Wiki? Who will be the first to create a page and post a FAQ? The culture of the list is part for Struts Community. The founders of Struts have a way of being welcoming and educational without lecturing, that makes people feel welcome and impressed. I do not have that gift, ... but the community should try to help people that do ask questions related to Struts. But if they can't even find a Struts home page, I think... if they can't browse, should they even code in Java. ( Maybe they are one of the expert designers that do not know how to code. See, I do not have that gift) .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Lazy questions on this list
Here is the Wiki url ... should somone want to do a first post on FAQ, I will post 1 or 2... but I won't be first. http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsDocComments Maybe dev makes the Wiki page more prominent. Ted Husted wrote: Paul McCulloch wrote: Is it my imagination or are the number of downright lazy requests to this list getting worse? If the only replies any lazy questions ever got was http://www.catb.org/~esr/faqs/smart-questions.html then maybe people would get the point. Has anyone got any other ideas about how we can educe the amount of lazy and totally off-topic posts to the list? Welcome to the darkside of being the world's most popular web application framework. :) IMHO, the very best way to handle easy questions is with a link to the answer. Where can I download Struts? http://jakarta.apache.org/struts/acquiring.html HTH, Ted. Struts setup and IDE? http://jakarta.apache.org/struts/userGuide/installation.html http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsMyFavoriteIDE HTH, Ted. - Simple, efficient, and to the point. Once you've pointed them at once answers, perhaps they can start finding the others on their own :) If the answer doesn't exist as a link, a very good approach would be to create a wiki page and then link to that. Like bugzilla, the wiki is open to all comers. You don't have to be a Committer to post. http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages For questions not directly related to Struts, one of the links on the preface page will usually be on task: http://jakarta.apache.org/struts/userGuide/preface.html HTH, Ted. -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Improvements on an old Struts app
You know in Struts you could submit on entering a field to get your options, but you did not do that I assume for good reasons. Let me try this as a stab: Please read this: http://jibbering.com/2002/4/httprequest.html section on Calling a server-side Script without refreshing the page Then once you understand that, this: http://www-106.ibm.com/developerworks/library/wa-resc/?dwzone=web or other similar, even XML-RPC via .js. So I would design this is: Type in a field. .js calls to get a list for an options sellection And capture the selection. Of course since you need to do this a few times, you can write some helper reusable methods. The form saves should still be done in Strtus. .V Wendy Smoak wrote: I gather that this is frowned upon: forward name=resolution path=/resolveName.do / However, when I wrote the app, I couldn't find a way around it. The flow is that you type a name in field 1 on form A, you get a list of possible matches, and you pick one and return to form A which inserts that name in field 1. The complication is that there are multiple fields on form A that need this behavior. And then there's form B and C that also need to use this name resolution. I had to resort to sticking String in request scope and using that as the target of the resolution form (which isn't a Struts form): form action=c:out value=${returnTo}/ method=POST I'm using a recent nightly build. Is there anything in there that can solve the go back where you came from problem? And once you get back where you came from, I also need to know which field you were trying to resolve. If it sounds like a mess, it is! (But it's working...) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts - 24 x 7 Compatible
Puneet Agarwal wrote: Hi all, Would it be possible and desired to make struts based applications be available on 24x 7 basis. What I mean is for a struts based application deployed in production environment, the possible downtimes are two 1. Dependency down - like Database backup. 2. Next Release of the application to fix the bugs, or an upgradation. I target the second point. Now as regards to feasibility, I don't think that is a problem, we can easily start a thread to address the best possible design. all I am trying right now is only the acceptability, do other people also require this, and how does it fit with the struts future plans. I've been hot-releasing new versions of Struts apps for years (on Resin) so I don't see that this issue has anything to do with Struts. It has to do with making all session objects serializable, and proper configuration of the app server to preserve sessions over a restart. Is there more you have in mind? Will Above was posted in dev, it should be in user. Similar to: http://theserverside.com/home/thread.jsp?thread_id=22504 I think using sesion fail over adds complexity and reduces stability. A good way I think is to use a sticky bit at CISCO round robin to app server A, B, C Once a session is created, all the requests go to the same box. In the unlikely situation of a box failing, the user gets a new session on remaing boxes. This is much simpler to maintain. Any hot (and distributed cache fulusing) can be done via iBatis/oscache. I also monitor app in production via JaMon (OSS) .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT: Good UI editor to use with Struts?
I use Eclipse, with Colorer plug in for JSP; and Sydeo plug in for JSP debuging. .V Davidson, Glenn wrote: Which UI editor would you recommend someone use when developing web applications based upon the struts framework? I am using eclipse as my IDE. Thanks -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator's great!
I just wanted to say Validator is great! And like Matt said, not in action/ actions should be stupid, in formbean, ie: errors=bean.validate(); (which then also makes .js validation work) .V Kruse, Matt wrote: Using either customized Java code or regular expressions, a developer can ensure that any incoming form data is legal and valid. This is a tremendous help to any developer as it prevents bad data from being processed by their Action and, many times, causing the user to see annoying 500 errors. I'm not sure why any Action would bomb out from invalid data. If that happens, IMO, you're putting too much logic in your Action. IMO, data validation belongs at the BO level. No matter where your data comes from, your BO should decide for itself whether or not it's valid before it tries to process it. It shouldn't just assume that it will get valid data. For this reason, in one project I completed, we ignored client-side validation nearly completely, and instead relied on server-side validation coming from the BO's themselves. This way, no matter what screen tried to do what operation, correct error messages would be given back to the user and the screen would re-paint. This was a lot easier and more logical to me than having each screen (which is simply a view to data) know exactly what kind of data is valid for what it is displaying. Doing it at the BO level, if there is a change in one validation, it gets changed in one place, no matter how many screens can updated that piece of data. Much easier, IMO. So, I'd like the Validator framework to work at the BO level and the javascript/screen level, and skip the Action level altogether. I prefer my Actions to be really, really stupid - traffic-controllers only, not data handlers. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: datavision and struts
I use this: http://ireport.sourceforge.net .V [EMAIL PROTECTED] wrote: Does anyone use datavision as reporting tool together with struts? any examples? thank you. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Handling database connection exceptions
Jim, action's execute throws exception; this exposes the container to deceleertively do this, if you declare an error page in web.xml. .V Jimmy Emmanual wrote: Why don't you throw the exception from the Data Access class and catch it in DispatchAction and if there is an exception then forward to the error jsp page else to the display jsp? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterate a Collection inside a bean of session???
For option tag, you might want to use the optionCollection tag instead for a collection. .V Mauricio T. Ferraz wrote: I have a produtoBean on session and this has a property ArrayList formatosArquivos How I put the value of option to the same name of bean:write name=formato/ ? logic:iterate id=formato name=produtoView property=formatosArquivos indexId=index scope=session html:option value=?bean:write name=formato//html:option /logic:iterate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts comparison
Struts comparison to WebWork: http://www.jroller.com/page/mrdon/2003#re_struts_vs_webwork_technical .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts - sometime the form is being submitted twice
Read up on Tokens in the Action class. It explains how to eliminate this ( that would have also happened even in a regular non struts servlet/jsp). hth, .V Judy Spengeman wrote: Using the following code fragment: function f_ValidateForm(later) { var newline = unescape(%0A); var leading_space = ; var ni = newline + leading_space; } // end with if (later == 1) { document.formq1.BUTTONPRESSED.value = FinishLater; document.formq1.submit(); } else if (later == 0) { document.formq1.BUTTONPRESSED.value = NextPage; } return true; } FORM ... action=/SampleApp/questionnaire.do INPUT type=button name=FinishLater value=Save and finish later onClick=return f_ValidateForm(1) INPUT type=submit name=NextPage value=Continue onClick=return f_ValidateForm(0) Prior to moving the questionnairre Servlet\JSP to implementing a Struts Action class, the form was being submitted to the servlet without any problem. Now all of a sudden (on rare instance), the form is sometimes being submitted twice - returning with a error due to a duplicate table entry. Can anyone determine the cause of this (besides the FinishLater submitting the form and then returning true to the button)? Is this something within Struts? Why has this cropped up only now as this code has been in production for quite a while with the 'submit/return true'??? Is it WebSphere 5.0? Struts? Please help!!! _ MSN Messenger with backgrounds, emoticons and more. http://www.msnmessenger-download.com/tracking/cdp_customize - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet filter and Struts
This is the standard way to do what you want... in web-xml only, using J2EE for container (such as tomcat JDBC realms) for security, a best practice. Once you know this part of JAAS, then you can extend, to put more things about the user in session, and track that in you actions. !-- guest -- security-constraint web-resource-collection web-resource-nameSecure/web-resource-name url-pattern/do/admin/*/url-pattern url-pattern/do/what/*/url-pattern url-pattern/do/not/*/url-pattern /web-resource-collection auth-constraint role-nameVALID/role-name role-nameENHANCED/role-name role-nameGUEST/role-name role-nameEXPIRED/role-name role-nameADMIN/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/loginBad.jsp/form-error-page /form-login-config /login-config security-role role-nameGUEST/role-name /security-role security-role role-nameVALID/role-name /security-role security-role role-nameENHANCED/role-name /security-role security-role role-nameEXPIRED/role-name /security-role security-role role-nameADMIN/role-name /security-role /web-app Steffen Gransow wrote: Sorry, wrong mailing list I guess. :\ But what I would like to know is: If I do forward to a specific page in a servlet filter, what would the code look like? RequestDispatcher rd = context.getRequestDispatcher(/kvnet/login.jsp); rd.forward(request, response); Or should I use /kvent/Login.do? Or am I totally wrong? Thanks in advance. Steffen -Original Message- From: Steffen Gransow [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 11:54 AM To: [EMAIL PROTECTED] Subject: Servlet filter and Struts Hi, I want to implement a servlet filter to redirect users to login when there is no valid session. Now I have a simple Struts application with a welcome and a login page. As soon as I add the filter my 'application' stops working. How do I implement a servlet filter in a correct way to achieve what I want? My web.xml looks like this: filter filter-nameloginFilter/filter-name filter-classde.quasa.kvnet.util.LoginFilter/filter-class init-param param-nameloginPage/param-name param-value/jsp/login.jsp/param-value /init-param /filter filter-mapping filter-nameloginFilter/filter-name url-pattern/*/url-pattern /filter-mapping The init-param isn't used at the moment. Is the pattern correct? I would access my app with a url like this: http://localhost/kvnet Are there good resources for me to read? Thanks in advance. Steffen -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT JDO Implementations]
Do not cross post. Consider iBatis.com(best one IMO), and write a DAO interface. This way later you could switch. .V Butt, Dudley wrote: Hi all, I'm just wanting to find out from anyone who may have started using any JDO implementations? We really want to go JDO, but so far, we found only 2 fairly ok implementations - JDO Genie from www.hemtech.co.za and Exadel Studio. Of course, we must not forget Hibernate as a big player, which also looks great, but is not yet JDO compliant, but then again, doesn't need to be as yet. I really just looking at getting some input from anyone whose used an implementation on a project and found it to be greatI'd really like to hear from you. Many thanx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: Re: newbee: eclilpse struts-jsp tag suport plug-in
This is an Eclipse new group question. There are several pages that list all the Eclipse plugins (links on cheat sheet page on StrutsPlus.com). I use XML buddy w/ smart typing for any XML, including JSP and Colorer plug ins. (also I use JFaceDB plugin for DB exploring) Also consider DreamWeaver (or M7, Camino, fwasi.com, Exadel, etc.; all linked on Cheat Sheet page) But once you get more experience you end up doing a lot in gVIm.org Noel Cornejo wrote: -- Hi ! I'm using eclipse since two days ago and it does'nt support struts tags, please. where could i find a plug-in for that? thanks! -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PLEASE HELP: Exception handling
Say this in WEB.XML error-page exception-typejava.lang.Exception/exception-type location/error.jsp/location /error-page Then this in error.jsp or what ever you consider friendly: %@ page isErrorPage =true % You are at a J2EE error page: p %= exception.getMessage() % and then: throw new Exception(Oops, I did it again); Or if you want to localize. There are many variations, but KISS will start you. .V Bard A. Evjen wrote: Can anyone provide me with a complete example of using execption handling in struts that supports a nice message to the user and the actual error message (displayed on the jsp page)? (I'm using struts 1.1) I think I've tried everything now (well, obviously not everything since it is not working), so I would REALLY appreciate the help. You can either point me to a page where I can download a complete example or you can send it to me on bardevjen at operamail.com Thanks a lot! Regards, Bard -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with charset iso8859_1 and encoding
Consider posting in TagLibs list. This is covered very nicely in JSTL (aka Standard Tags), read up on set encoding in http://java.sun.com/webapps/download/Display?BundleId=8776 and let me know if you then have a question. They even have examples. (or start here http://jakarta.apache.org/taglibs/doc/standard-doc/standard/index.html) Also both JSTL books cover encoding. .V alvin antony wrote: Hi *, I am desperately looking for a solution on this. Sorry for my poor knowledge on Unicode standards. Problem: In my application users are allowed to type data in different languages, for example 'Greek'. A Greek alphabet ' Ã ' is represented in ISO8859_1 as #915; but when I use any of the tags in struts, it converts this to amp#915. I assume struts treats '' as HTML sensitive comp.. but it isn't here. When i use %=myBean.getProperty() % it prints ' Ã ' that is correct. I write two lines in my jsp's to convert to ISO8859_1. 1. META http-equiv=Content-Type content=text/html; charset=iso8859_1 / 2. [EMAIL PROTECTED] contentType=text/html; charset=iso8859_1 % any help is highly appreciated Thanks in advance Alvin alvin antony [EMAIL PROTECTED] wrote: Hello guys, I didn't found any from Struts solution for the my last mail (find below), but I managed to correct it by adding a line in my Tiles layout file Now I run into new problem that, the not understands this charset or interprets differently :-/ . I have to set 'filter' to false, in order to work. If any anybody know where I have to set that DEFAULT value for 'filter' in is FALSE instead of TRUE? I tried set in the struts-bean.tld's found in /WEB-INF folder and in the Struts.jar. doesn't help:-/ .Any help? Thanks a lot Alvin alvin antony wrote: Hello Friends, I am coming back to the Struts mailing list after a long period. I have a problem with my Struts Application , that allows the users to fill in a form. When a user type in Greek letter's into the application and later reads backs to the browser from the application it shown as another letter, but when I change the coding on the browsing to Greek(Windows), it shows the correct letter. Is it possible encode characters automatically from Struts Framework. I tried already to define Controller in the Struts Config as given below . but with out success. If any body can help us on this, would be great. Thanks Alvin Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now. Alvin K. Antony Ludwig-Maximilians-Universität München Referat Internet Softwareentwicklung Oettingenstraße 67 80538 München Germany --- Phone: +49 (0)89 2102-5979 Fax: +49 (0)89 2102-5980 Mobile: +49 (0)160 97340713 E-Mail: [EMAIL PROTECTED] Web: http://www.lmu.de/internet/ Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now. -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on compositing Tiles dynamically from Action
Flip it and revrse it, go to tiles, that call actions: definition name=myPage1 extends=baseLayout put name=body value=/do/myPage1/ put name=tile value=/do/myTile/ / definition name=myPage2 extends=baseLayout put name=body value=/do/myPage2/ put name=tile value=/do/myTile/ / And then yor Struts mapping forwards are forward name=Success path =/WEB-INF/jsp/myPage1.jsp ... forward name=Success path =/WEB-INF/jsp/myPage2.jsp You can (should?) have a /do in a tile, for action to figure out what JSP to assemble. Also explained in Tiles 201. .V Brice Ruth wrote: I have an Action that will do some DB things and currently return a pre-defined ActionForward that links to a pre-defined Tile definition. Examples are below. What I want to do, is save myself some typing, and assemble the tile definition dynamically in the Action, and then return a new ActionForward for that definition (or something like this). The reason being, the forwards Tile definitions (currently) would need to be duplicated 4 additional times to support the different sections of our site. Any suggestions? I'd need to be able to create definitions that extend pre-defined ones (like .baseLayout.garden) as well as setting attributes that reference pre-defined definitions (like .mainLayout). Thanks in advance! Forwards: forward name=displayProduct path=garden.product/ forward name=showCategory path=garden.category/ Tile-Defs: definition name=garden.product extends=.baseLayout.garden put name=mainLayout value=.mainLayout/ put name=navigation value=.navigation.level3/ put name=content value=/common/tiles/productContent.jsp/ /definition definition name=garden.category extends=.baseLayout.garden put name=mainLayout value=.mainLayout/ put name=navigation value=.navigation.level3/ put name=content value=/common/tiles/productCategoryContent.jsp/ /definition -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on compositing Tiles dynamically from Action
Brice Ruth wrote: This still doesn't keep me from having to duplicate entries for each section of our site (we have 5 - garden, school, office, crafts, housewares) - and other non-Action driven pages need the same .baseLayout extended Tiles for each of the sections (.baseLayout.school, etc.) - and those definitions define the sections colors and a variety of other things. Yes it does! Specificaly, you do not need to create custom definition if you are only changing styles, etc. Read my example again (and maybe Tiles 201). See how an definition can have a variable part? You then define a single Strut action, to provide the variation. Good luck, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on compositing Tiles dynamically from Action
Let me try it this way: _DO NOT_ call a /do from your definition to provide varibility by calling an action from tiles, so that you have much less definitions. Also, DO NOT loook at this : http://cvs.sourceforge.net/viewcvs.py/basicportal/bPproj/bP/WEB-INF/config/layoutsShop.xml (a shoping cart example and it's layout that calls action from tiles) hth, .V Brice Ruth wrote: Brice Ruth wrote: This still doesn't keep me from having to duplicate entries for each section of our site (we have 5 - garden, school, office, crafts, housewares) - and other non-Action driven pages need the same .baseLayout extended Tiles for each of the sections (.baseLayout.school, etc.) - and those definitions define the sections colors and a variety of other things. Yes it does! Specificaly, you do not need to create custom definition if you are only changing styles, etc. Read my example again (and maybe Tiles 201). See how an definition can have a variable part? You then define a single Strut action, to provide the variation. Good luck, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] Why people want to know who read their msg?
James Mitchell wrote: If you don't like Outlook features, stop using Outlook. +1. Outlook also spreads viruses. I use Mozilla based mail client (Netscape, etc.) and have less of a need to run any virus checkers, becuase it's just a better mail client. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-chain
BaTien Duong wrote: i am able to have struts-chain example (the old struts-example with struts-chain built from cvs) up and running using j2sdk1.4.2_02 and tomcat 5.0.14. Where did you find an example of using a Struts chain? .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
This should all be done is SQL. At a design stage, you take your outputs (mock up html pages or reports. I am sure you or anyone has a screen with 30,000 records on it, or even a 1,000) and do some data model. Based on your analysis you should know the SQL. If this is hard for you, then attach a html mock up of you screen one and screen 2. I will write the SQL for you based on those requirements. So far I think it's a simple 2 way join (people write 12 way joins, or 10 page stored procs, quite possible you are concrend about a problem that does not exist. I tell you it's sub second! Also you just went from 300,000 to 30,000... maybe it's 3,000 or 3,000,000. It does not mater the records, it's a 2 way equi join. ) Recomendation to the list: Please read Celcko's SQL for Smarties, my all time fave for designers. .V Jerry Jalenak wrote: Vic - This is still in the design stage, so I don't have a SQL statement to provide. I'm looking for the best approach to handling what is essentially a table lookup where I need two keys (BILLING_ACCOUNT and ACCOUNT_CODE) The scenario is this: When one of my clients logs on to the webapp, the app determines the BILLING_ACCOUNTs the client has assigned, then explodes the BILLING_ACCOUNTs into the composite ACCOUNT_CODES. As an example, I've got one client with 54 BILLING_ACCOUNTs; these explode to over 30,000 ACCOUNT_CODES. I am trying to eliminate 30,000 db calls to get the account information - that's why I'm looking to pre-load the table(s) in a plug-in and access everything in memory. Make sense? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:46 AM To: [EMAIL PROTECTED] Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North
Re: [OT - Design] Needing Fast Access to 300,000 Records
[EMAIL PROTECTED] wrote: retrieving all the records because just in case the client may need them does not look very efficient approach to me. One never designs for all the exceptions of what might be, that would be a bad design. One designs for the likely case only, at least good designers do. The old 80/20 rule. (Unlikely excetiopns you deal with by doing exception procesing) But you design for the rule, else you are fighting your design. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Practice : session vs. request attributes
Is it OK using session attributes (performance, memory, etc. ), even if you make sure session attributes are removed when no more needed ? I ALLWAYS use session for form bean and then clean up. I allways use request for read only beans (c:out, display tag, etc.) And there is a non-standard thing I do with formbeans, that is I implement Collection at BaseBean and have a DAO helper. Makes OO much cleaner. hth, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] Visual Tags for Struts 2004 Released
Would this support JSTL tags? In essence, if you can deal with tlds, it should. Bean and logic should not be used, JSTL should be used instead. Forest Arnold wrote: FWA Software, Inc released Visual Tags for Struts 2004 on 03 November 2003. Visual Tags for Struts 2004 is the latest release of FWA Software's extension suite that integrates the Struts 1.1 tag libraries with Dreamweaver. The major new feature in Visual Tags for Struts 2004 is support for modular installation of the six Struts tag libraries, providing web developers the capability to install only the tag library extensions they need. Visual Tags for Struts is the first commercial product to fully integrate the Jakarta-Struts 1.1 custom JSP tags with Dreamweaver MX. Visual Tags for Struts enables web developers to use Dreamweaver to create and maintain web pages for Struts-based web applications using both visual layout and editing and text-based editing of JSP pages containing Struts custom tags. FWA Software also released a new version of Visual Tags for Struts - Designer Edition. This version includes enhancements for upward compatibility with Dreamweaver MX 2004. Visual Tags for Struts is available for Dreamweaver MX on Windows. Full-function evaluation versions of the products are available for immediate download from FWA Software's web site (http://www.fwasi.com/products). -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] Visual Tags for Struts 2004 Released
Tomcat v3 level (Servelt 2.2, Resin 1.x); I do not think sigificant new development is on Tomcat v3 level. Servlet 2.3 is Tomcat v4 level (Resin 2, JSTL 1.03). I know projects live on Servlet 2.4, Tomcat v5 level (Resin 3, JSTL 1.1, JSP 2) They named product Struts Tags for 2004, next years version. I know people making noises about Portlet/Pluto and (bites lip) JSF today. If anyone redevelops and old app, they might as well upgrade to a new container, not like we have to upgrade each workstation in the Client/Server days. Take advantage of EL, other features. Dreamweaver out of the box support TLD's smart typing, so I am just saying why not work with other tags, that one would use in new development in '04, next year. .V Ted Husted wrote: If your container supports 2.3, preferring JSTL is a good idea. But many teams still don't have that option. -Ted. Vic Cekvenich wrote: Would this support JSTL tags? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts, Tomcat And Performance
You are of by a few orders of magnitude (2,000 to 4,000 concurrent is what I get using j:Rockit VM) A nice thing about layered MVC architecture is that you can stress test a layer, the Model layer for example. I use OpenSTA + DBMonster to simulate. I use JaMon to monitor live app., so I know what to stress. Should you need to change improve the Model, I *HOPE* you coded DAO via an interface, that would make it easy to change. I use iBatis DB layer and a fast DB, writing stored procs when needed. (Lesson for others, create a DAO interface) hth, Jonathan Holloway wrote: Does anybody have any information, case studies or figures they can share on the performance of struts under tomcat. Whats the maximum number of simultaneous users that can be supported by a single tomcat instance running struts? I've got up to around 40-60 but need to increase this to more like 150-200 simultaneous users. Any help would be greatly appreciated. Thanks, Jon. Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts, Tomcat And Performance
OpenSTA Read the great step by step tutorial that comes with it. Brice Ruth wrote: Hey, Vic - I'm looking to do some stress testing of our site before we deploy, can you recommend any good reference books/sites to get started in this area? Brice Vic Cekvenich wrote: You are of by a few orders of magnitude (2,000 to 4,000 concurrent is what I get using j:Rockit VM) A nice thing about layered MVC architecture is that you can stress test a layer, the Model layer for example. I use OpenSTA + DBMonster to simulate. I use JaMon to monitor live app., so I know what to stress. Should you need to change improve the Model, I *HOPE* you coded DAO via an interface, that would make it easy to change. I use iBatis DB layer and a fast DB, writing stored procs when needed. (Lesson for others, create a DAO interface) hth, Jonathan Holloway wrote: Does anybody have any information, case studies or figures they can share on the performance of struts under tomcat. Whats the maximum number of simultaneous users that can be supported by a single tomcat instance running struts? I've got up to around 40-60 but need to increase this to more like 150-200 simultaneous users. Any help would be greatly appreciated. Thanks, Jon. Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]