facebook

What the cause of "Duplicate local variable mediaType&a

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #208244 Reply

    simplebest
    Member

    I try to import a jbuilder9 project but some jsp files are not compiled. the problems is “Duplicate local variable mediaType” which I’ve never met in jbuilder, these jsp were normally running in tomcat and weblogic.

    I use nested table of displaytag, the codes like this:

    <display:column title=”sth”>
    <display:table list=”<%=(ArrayList)al %>” id=”child” class=”childclass” >
    …..

    can you give me answers? thank you !

    #208245

    Riyad Kalla
    Member

    1) Find the page where you are getting the error
    2) Find in the page where mediaType is defined (either by a scriplet, jsp:useBean or struts bean:define)
    2.5) Search for multiple occurances
    3) Look at the page to see if you have any include statements
    4) Check the included files to see if they define the same variable

    #213102

    Will Glass-Husain
    Participant

    Hi,

    Did you ever solve this? I’m having the same problem with nested tables using the DisplayTag library. There aren’t any includes in my page, just the nested <display:table>.

    WILL

    #213168

    Scott Anderson
    Participant

    Can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    #213234

    Will Glass-Husain
    Participant

    Hi,

    I’ve posted a bug report in the DisplayTag issue tracker on this.
    http://sourceforge.net/tracker/index.php?func=detail&aid=994355&group_id=73068&atid=536613

    The issue is that mediaType is defined as a variable in the tag library. When <display:table> is nested, some JSPcc implementations appear to use the same scope, others not. Hence MyEclipse reports this as an error, but the page works fine in Tomcat 5. (I assume MyEclipse uses a different JSP compiler than Tomcat?)

    Commenting out this line in the tag library and recompiling removed the error. (possibly removing tag functionality, I’m not sure).

    TableTagExtraInfo.java
    (note that PAGE_ATTRIBUTE_MEDIA = “mediaType”)

    // media type row number
    variables.add(new VariableInfo(
    TableTag.PAGE_ATTRIBUTE_MEDIA,
    “org.displaytag.properties.MediaTypeEnum”,
    true,
    VariableInfo.NESTED));

    It’s not clear to me whether this is a JSP problem or a tag problem. (e.g. should JSP compilations allow nested tags with the same local variable?).

    Requested info:
    Eclipse 3.0.0
    MyEclipse 3.7.2700
    Installed from an installer, loaded a week or two ago
    JDK 1.4.2_04 (eclipse & Tomcat)
    Tomcat 5.0.27
    Other plugins:
    subclipse
    maven

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: What the cause of "Duplicate local variable mediaType&a

You must be logged in to post in the forum log in