Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

Dwijen Bhattacharjee

+ Follow
since Mar 31, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dwijen Bhattacharjee

okey I think need to make my question more concise.. My query is suppose I have a attribute like studentId which must be unique and must be within the range 1 to 1000.

so for that my approach was
<simpleType name="studentIdType">
<restriction base="ID"> <!-- This will make the studentId unique-->
<pattern value="[1-1000]"></pattern> <!-- This will restrict the value within 1 to 1000-->

<attribute name="Studentid" use="required" type="studentIdType"></attribute>

whether this is correct way to write the requirement. Please assume the pattern is correct .
The problem I am facing that, If I generate any xml for this, Its not accepting the value for the attribute Studentid. I tried with 0 , 1 and some other random value.
its seems to me that its not accepting any number at all.

So please can anyone help me out why I am doing wrong.
Hi All,
I am completely new to the XSD . I have a requiremnt like that :
I have a element name Student of studenttype. It has an element name studentName and a attribute studentid(mandatory) (restrict values to 1- 1000)( make this ID).

So for that I have written the xsd like that

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="" targetNamespace=""
xmlns:tns="" elementFormDefault="qualified">
<simpleType name="studentType">
<restriction base="ID">
<pattern value="[1-99999]"></pattern>
<complexType name="Student">
<element name="studentName" type="string" />
<attribute name="studentid" use="required" type="studentIdType"
<element name="student" type="tns:studentType"></element>

now when I am trying to generarte the xml the it is like that " the value of the attribute studentid is not valid with resect to its type studentType"

can anyone tell me what I am doing wrong over here.
friends at last I have cleared SCJP5 with 98%. It all happens because of your help. so once again thank you.
8 years ago
I passed scjp today (98%). But I have some queries. It has been told to me from the test center that one mail will be send to my mail id which will contain my sun userid and password. but still now I didn't got any mail from sun.any idea how long it will take? And another query is My name is not properly spelled in the report .So how can i change the name?
Now I have a doubt --
whatever the code Vinitha posted at the beginning I simply copy pasted the same code in eclipse and it's generating the output-

the same code If i compile and run from command line its generating the output--
Exception in thread main java.lang.ClassCastException:java.lang.Integer

Both using jdk1.5.0_09.If The problem is with the for..each loop . Then why its generating two different output?
First I thought may be problem with my configuration . But then i thought if both the version is 1.5 then it should present the same output in all the places. Please clarify the doubt.
As per my knowledge I am trying to explain your doubt
Type erasure is only for compile time checking. It doesn't exist at runtime. In your code if you change the signature
public void addstuff(List<String> list) then list.add(43); will cause a compile time error. at that time you are not able to add integer in the list whose type is String.

When you are passing a generic list to a non generic method all the security will vanish there. You can add anything in that list.

I copy pasted your code and it executing fine. Not throwing any exception whatever you mentioned. So please execute your code once again.

Hi All,
I have very basic knowledge of webservice. Currently I am trying to convert the response of a Webservice as JSON . I follow the steps mentioned in the [url] [/url] link. Now I am getting the response as a JSON object . But the problem I am facing is that how to access the response from a java client . I only know the use of OMElement to access the response from a webservice . so whenever I am trying to access the Webservice using OMElement from java clent its throwing an exception that "Unexpected chracter {.... expected <" . As per my understanding OMElement expects XML so it's expecting a response which started with < charecter , as my webservice's response is JSON .So it throws the exception. My question is how can i access the JSON response from java client ?? It will be better if you will post some code snippet.
9 years ago
Thanks Jeanne. Thanks a lot. but i didn't understand the last line "However if you are holding something general - like an instance to a DAO factory - all users of the bean would want it". I am new to EJB world .So I don't have detail knowledge. It will be great if you explain these more.
Hi all,
I am very new to ejb and I have a confusion regarding stateless session bean.
I have created a instance variable inside the session bean ;and inside my business method I am appending the method parameter in the variable.ThenI am calling that method twice from client by passing the parameter "First" and" "Second" respectively and printing the value of the variable.
Now here is my confusion.As per my knowledge stateless session bean does not hold the state between successive method call.So i expected the output "First" and "Second" as during the 2nd call the variable should not contain any value during the first call.
But I am getting output as "First" and"FirstSecond". My confusion is Why in the second time it is holding the first paramvalue?
Below I pasted my code snippet :-
1) Session Bean Implementation Class

2) I am calling from client by :-
3) ejb-jar.xml is as follwes
<ejb-jar id="ejb-jar_ID">
<session id="EJBProject">

Thanks in advance.

[edited to add code tags]
[ August 27, 2008: Message edited by: Jeanne Boyarsky ]
According to my knowledge In Apply Request Values Phase each component in the tree extracts its new value from the request parameters by using its decode method. The value is then stored locally on the component.
Can I access the value from PhaseListener ? If it is possible then how can I get the value of each component in Apply Request Values Phase.
9 years ago
I have to use Ajax in 2-3 pages in my application and i do not want to use Richfaces. Right Now I have created a Servlet and calling that servlet and getting respons. But I don't think it is good way to do . Please tell me how can i handle ajax request in JSF . Can I do the same from any managed bean. If possible ,How?
9 years ago
Yes ,I have all the above mention jars in the WEB-INF/lib folder.
9 years ago
Hi All,
I am trying to configure richfaces for my application But i am getting the following error during deployment

Class : org.richfaces.renderkit.html.HtmlPanelMenuRenderer not found.
java.lang.NoClassDefFoundError: org/richfaces/component/UIPanelMenuGroup

I included the richfaces-api-3.2.1.GA.jar,richfaces-impl-3.2.1.GA.jar,richfaces-ui-3.2.1.GA.jar inside the WEB-INF/lib folder and added in the classpath.

my web.xmi file is as followes--
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="" xmlns:xsi="" version="2.4" xsi:schemaLocation="">


<display-name>RichFaces Filter</display-name>

<servlet-name>Faces Servlet</servlet-name>
<servlet-name>Faces Servlet</servlet-name>
<servlet-name>Faces Servlet</servlet-name>

That paricular class is present in side the richfaces-ui-3.2.1.GA.jar file but still I am getting the error.

Please help me out.
9 years ago
Hi All,
I want to know how can I use Ajax in JSF. For my application for the time being I created a servlet for handling the request and sending the response.But for that I am using HttpServletRequest and Response objects which I don't think is a good practice.
Can Anyone tell me how to replace the servlet and use any managed bean to handling the request and response.
It will very helpfull to me if you can provide any code snippet.

Thanks in advance.
9 years ago