FAQ Database Discussion Community


Java Empty String equals NULL

java,string,hibernate,null,struts
I have the following problem: We are writing a web application using Hibernate and Struts. Upon submit, I want to check, if a DB update has be executed or not. So I pull the Object out of the DB and compare it to the data in the form (let's assume,...

Struts servlet reusing HttpServlet object so parms get overwritten

java,jsp,servlets,struts
OK, this is baffling to me. I have a servlet that returns data for some graphical charts on a dashboard. The servlet takes an 'action' parm which tells it which DB query to run. This servlet is called 2 times on the dashboard page to return 2 different sets of...

using struts property in another struts tag

java,struts,common-controls
I am using Struts1; I am iterating through a list using logic:iterate <logic:iterate .... indexId="index"> and i would like to use the "index" property as an argument to be passed to a javascript function while pressing a button <ctrl:button ... onclick="return functioncall (index)"/> how is the sitax to access the...

How to showing realtime logs from server in jsp textarea?

ajax,jsp,java-ee,servlets,struts
Actually i need to show server's real time logs in Jsp textarea in a dynamic way.I have got logs by using ajax callback method but I do not know this is right way or not. Is there any solution to synchronize the server and client for fetching server logs to...

What will be equivalent Struts2 code for the following select tag code in Struts1

struts2,struts,struts-1,struts-tags
I am new to Struts. I have to migrate code form Struts1 to Struts2 but confused in select tag of Struts2. Please help in writing the equivalent code in Struts2. <nested:select property="pmt_type0" onchange="openTable(this,0)"> <html:option value=""></html:option> <html:optionsCollection name="paymentTypesList" label="paymentTypeDescription" value="paymentTypeCode"/> </nested:select> ...

Internal Server error while calling an Java method from JSP

java,jsp,servlets,struts,struts-config
This is my JSP extra.jsp: <%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <html> <head> </head> <body> <h1><bean:write name="HelloWorldForm" property="message"> </h1> </body> </html> this formBean HelloWorldForm.java: package com.redhat.rhn.frontend.action.common; import org.apache.struts.action.ActionForm; public class HelloWorldForm extends ActionForm{ String message="HelloWorld!"; public String getMessage() { return message; } public void...

Struts1 and Tiles: why does this code doesn't go into infinite loop?

struts,struts-1
1) I'm looking at some code that is perhaps Struts1 and was wondering if someone can explain why I'm not getting an infinite loop, and instead, I'm being forwarded to a jsp page instead: struts-config.xml: <struts-config> <global-forwards> <forward name="a.t" path="/Search.do"/> </global-forwards> <action-mappings> <action path="/Search" type="path.SearchAction" scope="request" name="searchForm" validate="true"> <forward name="orders"...

How to set an checked by default in Struts 1.1

jsp,struts,custom-tags
i'm trying to find out how to make a radio button checked by default when using jsp and struts 1.1 with custom tag. When i write my code this way : <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ...................................................................................<html:radio property="operazione" value="addizione" checked="checked">Addizione</html:radio><br /> eclipse say : Undefined attribute name "checked" and when...

Can Struts 2.3 be used with Struts 1.3?

struts2,struts,struts-1
we have 2 applications (Say AppA and AppB) that use Struts 1.3. I want to upgrade AppB to use struts 2.3, however I cannot make changes to AppA so it will have to remain in Struts 1.3. The problem is that AppB has some dependencies on AppA such as extending...

Combobox not show the correct language values in struts1

forms,extjs,combobox,struts,struts-1
Im using ExtJS and Struts1 for an application, when user uses this app in english and displays the combobox (inside form), the selection is in another language (spanish) but not in english. After save the form and reload the page this parameter shows in english (but if user displays the...

how to implement global redirect page in struts2

struts2,struts,struts-config
We're using Struts 2 in our web application. There are bunch of action mappings defined already, I want to implement a feature where any Urls starting with /buy and not mapped to any of the existing action mappings e.g. /buy/new or buy/old should be redirected to buy/index action. For example...

How Spring is injecting properties in Struts actions, that are not defined in applicationContext.xml

spring,java-ee,struts2,struts,integration
I am in a project having frameworks like Spring 3 + Struts 2 + Hibernate 3. Also it uses spring security. Spring and Struts is integrated using spring ContextLoaderListener defined in web.xml <listener> <display-name>Spring Initialization</display-name> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> There are several service classes which usually make db calls. like agentserviceprocess is...

What is equivalent Struts 1.3 tags for

java,html,struts2,struts,struts-1
I want equivalent Struts 1.3 tag for <s:property value="Content" escapeHtml="false" /> Currently I am trying something like <bean:write name="MyForm" property="Content" filter="false" ></bean:write> I want to hide/remove HTML tags from My Content - I am having data from CKEditor which is combination of HTML tags....

How to persist form bean object value to retreive it later in Struts 1

java,jsp,struts,struts-1
Using Struts 1.3 I have a login form with username, password and a drop-down with some values like English,Deutsh and so on. When a form is submitted, the last value need to be persisted from the drop-down. Following the code sample. Form Bean : public class LoginForm extends ActionForm {...

Variable property name in html:text tag

java,html,jsp,struts,struts-1
I'm using struts-1 and want to use a concatinated string as a property name in a html:text tag. The string is composed of a static String and a parameter given from a jsp:include tag. The include part <jsp:include page="test.jsp"> <jsp:param name="language" value="DE" /> </jsp:include> The html:text Param: ${param.language} <html:text property="propertyDE"...

Persistent authentication filter logging in; not propagating to JSP

jsp,java-ee,jstl,struts,servlet-filters
I've been working on a "Remember Me?"-style persistent authentication system, but after successfully authenticating and logging in the user, my JSPs do not reflect that the user is logged in until the next page request or refresh is processed. The cookie used for this is being written, and the database...

How do you clear a form after struts validation error

html,validation,jsp,error-handling,struts
I have a form (JSP) and I'm using Struts to validate the text fields. An example would be to display an error if the user enters numbers inside of the First name text box since it will only accept letters. The message stays on the screen along with the numbers....

Struts 2 autocompleter not working as dropdown

java,jsp,struts2,struts,struts2-jquery
I have a JSP page in which I have use sx:autocompleter. It is working but at the time of typing in textbox, suggestions are not coming in dropdown, they are coming as completing the word. Like this What is the problem here ? ...

The file download folder view in Struts

file,jsp,struts2,struts
I'm creating a project of a school. I want to show the uploaded stuff by teachers to students. But I also need to save the file in the folder which is named as faculty name. Student will be able to browse the main directory and after that he can go...

How to check file existence using Struts 1 tags?

java,struts,taglib
I need to check if the html file is present on certain path, if not, a message needs to be displayed. Is there any tag definition in Struts 1 which facilitates to check file existence?...

Cann't find ActionError class in Apache Struts 1.3.10

struts,struts-1
I follow the tutorial in book JakataStruts live (2004). I have code snippet: @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if(firstName == null || firstName.trim().equals("")){ errors.add("firstName", new ActionError("userRegistration.firstName.problem")); } //... return errors; Netbeans IDE notice that: "Cannot find symbol". How to resolve the above...

Use of logic:iterate with String array

java,arrays,struts,taglib
Im working with Struts and need to iterate list of string array i-e List<String[]> list = new ArrayList<String[]>(); im using this code to iterate <logic:iterate name="myForm" id="syncStringArrayId" property="list"> <tr> <td><bean:write name="syncStringArrayId" /></td> <td>2nd column should be index 1 of string array</td> <td>3rd column should be index 2 of string array</td>...