[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

STRUTS: Tags inside innerHTML

Posted on 2004-03-28
1
Medium Priority
?
2,727 Views
Last Modified: 2007-12-19
Hi!

I seem to be having problems using struts tags inside an innerHTML. The design of the page (in this case, it's a popup) is that I have a dropdown (let's say it's DropDown1 for now) box and beside it will be either a textbox or another dropdown(let's call this DropDown2 for now) box (depending on the value selected on DropDown1, it will either show a textbox of DropDown2). All the values for the dropDown boxes are taken from a db and stored in a collection(in my action for initializing the popup). I decided to use innerHTML for this one, but I seem to always get an error with the javascript code I have below. If I don't use struts tags (I tried it out with the regular html tags just to see test) it works fine...any help would be greatly appreciated. =)

I have the following declaration on my page:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Here's my javascript function:

function changeField()
{
      var value = document.advanceFilterForm.field.selectedIndex.value;
      
      if ( value == "Release Dates")
      {
            
          document.getElementById( 'valuediv' ).innerHTML =  '<html:select property="value" style="width:116px"><html:options collection="values" property="value" labelProperty="description" /> <html:select>'
      }
      
      else
      {
          document.getElementById( 'valuediv' ).innerHTML = '<html:text property="value" style="width:200px" />'
      }
}

</script>

Here's the error:

org.apache.jasper.JasperException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
0
Comment
Question by:rusco
1 Comment
 
LVL 7

Accepted Solution

by:
searlas earned 300 total points
ID: 10702375
Using struts tags implies that you have an object holding the values in your form.  As you do not specifyc a name attribute on the struts tags, struts searches for a bean with the key 'org.apache.struts.taglib.html.BEAN' in page, request, session, application scope (in that order.)

As you haven't set one up, the obvious question is, why are you using struts tags for this?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question