[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

STRUTS: Tags inside innerHTML

Posted on 2004-03-28
1
Medium Priority
?
2,712 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part III
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

649 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