xapp:choice gives internal error

X-Application Version: 4.1.1
Tamino Version : 4.1.4.1,
Platform : WinXP
WebContainer : Tomcat 4.1.17
JDK Version : 1.4.1

When I add an xapp:choice to my coding I get an internal error - web page attached. Without the xapp:choice the web page is displayed. The coding snippet follows:



Hello <xapp:display select=“/User/EmployeeNumber”/>

Type <xapp:display select=“/User/UserType”/>
<xapp:choice select=“/User/UserType” type=“1”>



</xapp:choice>

Where have I gone wrong?

Thanks
Apache_Tomcat-4_1_17_-_Error_report.htm (6.79 KB)

Hi Patricia,

sorry I can’t read your error page. Could you please wrap it with a zip container?

By the way, we currently have public holidays in Germany and therefore not all working on X-Application are in the office.

But afterwards we will help you as soon as possible.

Bye and a happy new year

Thorsten

Hi Thorsten
We too have holidays here so I really wasn’t expecting any help before next week. In the meantime I have got around the error by using xapp:if statements. I have saved the error as a text file so hope you can read this one.

Happy New Year
Priscilla
Apache_Tomcat-4_1_17_-_Error_report.txt (6.27 KB)

Hello,

I had a look at the error text. The problem is that the internal exception caused by the choice tag is encapsulated or hidden by a

javax.servlet.ServletException

and does not occur within the stacktrace.

Perhaps, a newer Tomcat version provides a better exception handling.

Therefore, I can only guess what the reason could be:

(1) The path “/User/UserType” does not refer a choice. We could verify this possibility if you post us the XML schema of your application.

(2) The User document is not have an associated schema. If you create / read / select a document without schema (not using the attribute ‘schema’ of an xapp:action or xapp:directcommand), yoiu can not use the tags xapp:loop and xapp:choice.


Bye,
Christian.

Hi Christian
I think I know what the problem is - I am trying to do a “choice” on the contents of an element and not on something defined as a choice in the schema. Please confirm if this is the case. I am attaching the schema and 2 jsp pages. The idea is to enter an employee number on testlogon.jsp and depending on the type of user the menu options will be displayed on testchoice.jsp.

Thanks - Priscilla
Choicezip.zip (2.42 KB)

Hello,

yes, your suggestion was right. You are referencing to an element (UserType) with simple content, but not to a choice. An element is a ‘choice’ if it is a complex element with choice term.

Example:

<xs:element name = "UserType">
  <xs:complexType>
    <xs:choice>
      <xs:element name="Administrator">
        <xs:complexType />
      </xs:element>
      <xs:element name="SDF">
        <xs:complexType />
      </xs:element>
      <xs:element name="Manager">
        <xs:complexType />
      </xs:element>
      <xs:element name="Employee">
        <xs:complexType />
      </xs:element>
    </xs:choice>
  </xs:complexType>
</xs:element>



In this case, you could use the xapp:choice for the element ‘UserType’.

In your case, you can use the xapp:if tag.

Bye,
Christian.