struts

A "Portlet-Like" java technolgy for a Web app

Hi, Do you know a technology which can provide me a portlet-like interface? But I do not want to use JSR 168/268 portlet specifications and a portlet container. The reason is: My web app is a product which can be installed on the client's server (it can be weblogic/websphere/tomcat). Packing the portlets container along with my applica...

404 response header using struts forward

Is it possible to set the http response header with a status of 404 instead of 200 when using struts forwards? We have a generic error page that goes out with a status of 200OK. We want to update the header to show a 404 instead. Is that possible? ...

Struts Versus Spring

Hi. Wanna ask which is better to use. Struts or spring. What are its edges over the other and the difference on their flow or how they work. ...

How to implement tab containers in web-application?

In modern web browsers we can work with multiple contents in parallel by using tab containers. It took me quite some time to mimic a similar behavior within a webpage of a web-app by using a library called Struts Menu. The solution as far as I understand is basically a combination of using CSS with calling JSP pages. I was wondering if ...

Session handling in a Struts application

Hi, I am facing an issue in handling an object in session. I store an object in the session like this.Assume object is the name of the object.I do this in my action class if(object!=null) { session.settAttribute("objectName",object); return mapping.findForward("success"); } else { return mapping.findForward("failure"); } I map both...

How to access Struts DynaValidatorForm properties form JSP

I have a struts action which populates a field. public ActionForward appForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { DynaValidatorForm dyna = (DynaValidatorForm) form; String identifier = (String) request.getParameter("id"); ApplicationDTO app = ma...

How can I obtain the message resources object in a servlet?

Hi everyone, I'm developing a project with Struts and I was wondering if it's possible to get the message resources object in a servlet, which is included in the same project. There's no possibility to get that object with the method getResources(HTTPServletRequest) because the servlet does not extends an Action class. Is there a way t...

Is there a Spring HandlerAdapter implementation for Struts?

This is just a curiosity question. I know that Spring can be used in a Struts ActionServlet (sp?) via certain means, but I was wondering if there was a HandlerAdapter that allowed old Struts code to be ported immediately to a Spring DispatcherServlet to use the DispatcherServlet as the front controller. ...

Struts help needed

Hi, I have an issue.I need to run a query to get a data say test from a table t.The query currently runs in an action class.Its taking 20 seconds to run.Now my problem is not all times t is going to have value and the users will be annoyed if I make them wait to check whether t exists or not. select t from table if(t!=null&&!(.equal...

Where can I learn about using Struts in Java?

Where can I learn about using Struts in Java? ...

No Hibernate Session bound to thread

I'm using Struts + Hibernate + Spring for my project development. And here is my Spring Context XML file. When I called "sessionFactory.getCurrentSession()" in the beginning of userDao.getXXXX method, the exception whose detail message is "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactiona...

Spring security and Struts 2

I have a struts2 action with an @Secured({"ROLE_ADMIN"}) to secure the execute method. In the execute method i assign a message to a member variable of the action, then return SUCCESS and end up on the jsp page. On the page I retrieve the actions member variable with <sroperty. private String greeting; public String execute() throws Ex...

Custom struts2 tag?

Hi all, I want to write a custom struts2 tag,which has a separate action class for itself, and can be called from different jsp pages. Something like: <s:writetext type="aaa" parentid="xxx" parentname ="yyy" height ="50" width ="125" /> Is it possible? Please help, I'm very new to this and googling about this didn't help. Thanks, A...

Is Struts2 still a good choice of web framework for new projects?

Once upon a time, Struts was the default choice for a Java web framework. I have no data on this, but I imagine that Struts2 is currently widely used for legacy reasons, only because former Struts projects have been migrated to it. Is Struts 2 really the best choice for a new project? What other web frameworks out there are most popula...

What validation should I use

I am working on a J2EE web application Here we are using JSP and Struts I know one can use Client side validation (Using JavaScript) Server side validation (Using Validation framework) My question is which way is more proper and one should use in application and why? ...

Forwarding in STRUTS

I am forwarding to an action by giving as <forward name="sample" path="/sample.do?button=default" /> i want to add one more attribute in path and i used: <forward name="sample" path="/sample.do?button=default&value=text" /> ...and I am getting org.xml.sax.SAXParseException Any solution for it? ...

if a JAR is placed on app servers's classpath how do we reference it from JSP

On our application we are getting an error saying: PWC6117: File "/struts-tags" not found code in the file thats giving error is: <%@ taglib prefix="s" uri="/struts-tags" %> This file is in struts2-core.jar which is placed on the classpath of the app server (Sun 9.1). The code will work fine and not complain when the jar is actual...

Struts form and variable declarations

Hi everyone, I have a question and I hope somebody can help me out here. Well, I'm developing an application with Struts 1.3.10 and I have a struts form with an object that contains a property. That property is declared as the primitive type int and the problem comes when the app shows to the user zeroes(0) instead of nothing when I ret...

Difference between Apache Struts and Java EE?

I'm currently learning Java EE, or more specifically, Servlets and .jsp. In my programming, I already employ the Model-View-Controller model to write my code. And as far as I've googled, Apache Struts is just a server like Tomcat. So, what exactly is Apache Struts, in relation to Java, Java EE, and Servlet classes in Java EE? ...

Validating Arrays using Struts Validator plugin / Commons Validator

I have a property in a Struts DynaValidatorActionForm that is an array of Integers: <form-property name="ids" type="java.lang.Integer[]"/> I'd like to perform a validation on each of these Integers. For example, let's say I want to validate that none of them is equal to the number 1: <field property="ids" depends="vali...