html:img page=????/
In Action I have httpServletRequest.setAttribute(image, /images/abc.gif); -/images/abc.gif is from database But I don't know how to put that in html:img to get this html:img page=/images/abc.gif/ I try like this html:img page=%=(String)request.getAttribute(image)%/ but this doesn't work!
How to use Struts to show image from database (byte[])?
I have images in database. Prior to Struts I use servlet to show image and in JSP or sevlet. I have /myPackage/imageservlet?imageID=1 How to use Struts to show image from database (byte[])? Thanks.
Right way to extends Action
I want all my Actions to extend BaseAction. In BaseAction I want to check user session and to put some data in it, if that data doesn't exist. Is it good way: public class SomeAction extends BaseAction { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { super.execute( mapping,form, request, response); OK, proceed ... public class BaseAction extends BaseAction { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { if (userSession is wrong) { -try -- put data in session -catch -- return mapping.findForward(wrongSession);} else return null; //everything is OK What you think about this way and is there better way to extend Action? Thanks.
Bitmechanic JDBC Connection Pool or Struts Connection Pool
I search the [EMAIL PROTECTED] but I didn't find anything on how to setup Bitmechanic JDBC Connection Pool. http://www.bitmechanic.com/projects/jdbcpool/ Does someone can explain me how to setup Bitmechanic in struts-config.xml, web.xml and how to get connection in Action? I use MySQL: jdbc:mysql://localhost/MyDB user name:aa password: bb Or, does Struts have connection pool? If yes, how to setup with my MyDB. Thanks!
struts - RequestProcessor
I was found this for RequestProcessor protected boolean processPreprocess( HttpServletRequest request, HttpServletResponse response){ boolean continueProcessing = true; HttpSession userSession = request.getSession(false); // Check to see if there's a session for the user that wasn't just created if ( userSession == null || userSession.isNew() ){ continueProcessing = false; response.sendRedirect( /login.jsp ); } // Tell the RequestProcessing to continue processing the request or not return continueProcessing; } And explanation is: The manner in which Example 9-3 specifies the path in the sendRedirect() method is not the best approach. This redirect would only work if the example was running as the default web application and there was a login.jsp page in the root directory. It was done this way to keep the example simple. A better approach would be to retrieve the ActionForward for the login page and use the path from it in the sendRedirect() method. That way, if the actual page changed for the forward, this method doesn't have to be modified. How can I get ActionForward to make something like this: -actionMapping.getInputForward() -actionMapping.findForward(homeAction) ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic tags and collections?
Try struts menu http://sourceforge.net/project/struts-menu. Edgar PAGE NOT FOUND I try to search at sourceforge.net, but I didn't find anything like struts-menu. Where is it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where to find more about Struts JSF - Server Faces?
Can I use it in real development or this (Struts JSF and SUN JSF) is just big beta? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Logic tags and collections?
How can I make something like this with Struts or someone have better idea? I have few Admin: MainAdmin, UserAdmin, EmailAdmin. MainAdmin can do anything, UserAdmin manage users and emails, and EmailAdmin make emails only. So, I need this: -without Struts, I make Collection in session and If session.getAdminTypeCollection contain MainAdmin { do something If session.getAdminTypeCollection contain UserAdmin OR MainAdmin { do something If session.getAdminTypeCollection contain EmailAdmin OR UserAdmin OR MainAdmin { do something } End EmailAdmin } End UserAdmin } End MainAdmin For MainAdmin Collection: Collection.add(MainAdmin) Collection.add(UserAdmin) Collection.add(EmailAdmin) For UserAdmin Collection: Collection.add(UserAdmin) Collection.add(EmailAdmin) For EmailAdmin Collection: Collection.add(EmailAdmin) -do something are links MainAdmin see all links UserAdmin see UserAdmin and EmailAdmin links EmailAdmin only EmailAdmin links I can't use role or principal or anything from JAAS. So, I need somehow to check Coolection with logic:present or some others tags? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Two problems: bean:include and return errors
I have index.jsp that include login.jsp If I use in index.jsp bean:include id=login page=/login.jsp/ bean:write name=login filter=false/ logic:present name=bean scope=request doesn't work in login.jsp. I put bean in Action. logic:present name=bean scope=request only works in index.jsp. But with [EMAIL PROTECTED] file=login.jsp% it's works!? Why is that? - I have in LoginActionForm for login.jsp ActionErrors errors = new ActionErrors(); if (name.equals()) { errors.add(name, new ActionError(name)); } return errors; and this in LoginAction if (form.getName().equals(x)) { errors.add(name, new ActionError(badName)); saveErrors(httpServletRequest, errors); return actionMapping.getInputForward(); This works OK, but didn't return to index.jsp it return to login.jsp. I get only login.jsp form not index.jsp - whole page *index.jsp include login.jsp Thanks.