 |
| J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 13th, 2003, 12:55 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Deploying to sun app server
Hi all,
I'm trying to follow the 'Getting Set' section of 'beginning j2ee 1.4' and am running into some difficulties. Firstly, this deployment setting dialog under 'File | deployment Settings | Create New File..' seems to have dissapeared. Where can I find this?
Secondly, when I try and verify I get a failure in tests.web.spec22.JspFileName - 'Error: Jsp [ /index.jsp ] starting with a leading /
Any ideas about either of these, or should I just take this book back now its not officially supported?
Cheers,
Mark
|
|

August 3rd, 2003, 01:06 PM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You are right. The deployment setting is not there. And even worse, when I am trying to create a War, the tool won't generate XML descriptor for me. It's blank. Have you noticed that?
or is it only my problem?
|
|

August 10th, 2003, 11:41 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Guys,
I have gone through the "Getting Set" Of Beginning J2EE1.4 and everything is working as stated.
I had one problem at the beginning - but on closer inspection found that it was my problem (typo? nahhh not me!). I removed everything a second time - tried again and it works great.
My suggestion is to try again being very careful to do exactly what is stated (XML Deployment file for wars is O.K. as well).
As far as items being disabled in the menus - perhaps you are not in the proper context ? Don't know for sure - but it is possible.
If you are still having problems after being certain it is not yours - then perhaps look at your Java Environment - or perhaps the Deployment Tool itself (bad install/download?).
I hope this helps,
Nelson
|
|

August 14th, 2003, 08:47 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I think that the there have been a few changes in the latest beta release of J2EE that have made working through Beginning J2EE 1.4 something of a challenge:
1) The "deploytool" interface differs from the described ("Deploy..." is now under the "Tools" menu, for example).
2) Cloudscape is no longer distributed with J2EE, there's a Pointbase database that is part of the distribution but I haven't tried using it as yet.
3) Much of the code seems to require a fair amount of debugging. For example, SimpleList.java uses:
getJspBody().invoke(null, params);
JspFragment's invoke() method only takes one parameter.
In order to get the examples running, I've been using the book in conjunction with Sun's J2EE Tutorial. Three days in, and I'm not sure how much more I can take. I would've returned the book, but I can't find anything better on the shelves. Any suggestions?
|
|

October 21st, 2003, 03:59 AM
|
|
Registered User
|
|
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
As jhenson wrote, the invoke method of the JspFragment interface only accepts one parameter - the Writer, alas this code in the book doesn't work:
getJspBody().invoke(null, params);
Has anyone found a solution?
/Johan Nyberg
|
|

December 7th, 2004, 11:07 AM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here is your solution:
while(faqs.hasNext())
{
getJspContext().setAttribute("question", faqs.next());
getJspContext().setAttribute("qid", getTopic() + "_" + count);
count++;
try
{
getJspBody().invoke(null);
}
catch(IOException err)
{
throw new JspException("Error processing body: " + err.getMessage(),err);
}
}
The getJspBody().invoke() method has changed, but you can add your params as attributes throught he getJspContext() object.
Steve
Quote:
quote:Originally posted by deckard
As jhenson wrote, the invoke method of the JspFragment interface only accepts one parameter - the Writer, alas this code in the book doesn't work:
getJspBody().invoke(null, params);
Has anyone found a solution?
/Johan Nyberg
|
|
|

December 21st, 2005, 12:39 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Please help
I keep getting this error message after compiling the following SimpleList.java on page 123 from the "BEGINNING J2EE 1.4 FROM NOVICE TO PROFESSIONAL" book. I don't know what to think anymore about the authors of this book!!!!
C:\jakarta-tomcat-5.0.28\webapps\Ch04\WEB-INF\classes\Ch04>javac SimpleList.java
SimpleList.java:21: cannot resolve symbol
symbol : class Questions
location: class Ch04.SimpleList
Questions questions = new Questions();
^
SimpleList.java:21: cannot resolve symbol
symbol : class Questions
location: class Ch04.SimpleList
Questions questions = new Questions();
^
2 errors
And this is the SimpleList.java:
package Ch04;
import java.util.*;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
public class SimpleList extends SimpleTagSupport {
private String topic;
public void setTopic(String s )
{ topic = s; }
public String getTopic()
{ return topic; }
public void doTag() throws JspException {
Questions questions = new Questions();
questions.setTopic(getTopic());
// Get List of questions, TreeMap will sort them by key
Map qmap = new TreeMap(questions.getQuestions());
Iterator faqs = qmap.values().iterator();
int count = 1;
while(faqs.hasNext()) {
try {
//Store the parameters for invoke()
getJspContext().setAttribute("question", faqs.next());
getJspContext().setAttribute("qid", topic + "_" + count);
count++;
//Process the body
getJspBody().invoke(null);
} catch (IOException e) {
throw new JspException("Exception processing body");
}
}
}
}
This is the Questions.java:
package Ch04;
import java.util.Map;
import java.util.HashMap;
public class Questions {
private String topic;
private int numTopics;
private Map questions = new HashMap();
public String getTopic() {
return topic;
}
public void setTopic(String t) {
topic = t;
}
public int getNumTopics() {
return numTopics;
}
public void setNumTopics(int n) {
numTopics = n;
}
public Map getQuestions() {
return questions;
}
public void setQuestions(Map m) {
questions = m;
}
public Questions() {
questions.put("1", "How do I use impicit objects?");
questions.put("2", "How do I use the JSTL?");
questions.put("3", "How do I use the 'empty' operator?");
setNumTopics(questions.size());
}
}
Can anybody sees the problem? I can not continue until I find this problem..
Thank you
Ditony
|
|

December 28th, 2005, 02:53 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by jhenson
I think that the there have been a few changes in the latest beta release of J2EE that have made working through Beginning J2EE 1.4 something of a challenge:
1) The "deploytool" interface differs from the described ("Deploy..." is now under the "Tools" menu, for example).
2) Cloudscape is no longer distributed with J2EE, there's a Pointbase database that is part of the distribution but I haven't tried using it as yet.
3) Much of the code seems to require a fair amount of debugging. For example, SimpleList.java uses:
getJspBody().invoke(null, params);
JspFragment's invoke() method only takes one parameter.
In order to get the examples running, I've been using the book in conjunction with Sun's J2EE Tutorial. Three days in, and I'm not sure how much more I can take. I would've returned the book, but I can't find anything better on the shelves. Any suggestions?
|
|
|

December 28th, 2005, 03:00 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I gave up on the last pages of the JSP chapter from the Beginning J2EE 1.4 From Novice to professional book....I had the same problems as the rest of you...This is worse book I have ever read and has been written just to make money....
TO ALL OF YOU DO NOT GET DISCOURAGE THERE ARE PLENTY OTHER BOOKS TO LEARN FROM IT
Ditony
|
|
 |