Solved

STRUTS: Tags inside innerHTML

Posted on 2004-03-28
1
2,630 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 75 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

An article on effective troubleshooting
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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