Err...
Just realized my last post wasn't very helpful.
Try this:
javac -c {Installation Path}\lib\cfx.jar SimpleMessage.java
Andr�
-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]
Sent: 03 June 2003 11:10
To: CF-Talk
Subject: Can someone help me understand how to import com.allaire.cfx
Hi all,
Im trying to write a small java app with the view to pulling them in
with CF
for some
tasks suited to the job.
This app has been copied straight from "Java for CF Developers",
//SimpleMessage.java
import com.allaire.cfx.*;
import java.util.*;
import java.text.DateFormat;
public class SimpleMessage implements CustomTag{
Date now=new Date();
DateFormat
f=DateFormat.getDateInstance(DateFormat.FULL,Local.US);
public void processRequest(Request request, Response response)
throws Exception
{
f.format(now);
String name=request.getAttribute("NAME");
response.write("Hello, "+name+"! Today is "+f);
}
}
this file sits in c:/cfusionmx/wwwroot/web-inf/public/
obviously I want to implement this as a custom tag so Im trying to
import
the Allaire interfaces - com.allaire.cfx,
this sits at c:\cfusionmx\lib\cfx.jar
The problem is I can't,
the classpath is set in administrator as c:\cfusionmx\lib\cfx.jar,
I tried putting the jar file in the same directory as my java file,
I also tried javac -classpath %classpath%;c:cfusionmx\lib\cfx.jar
c:\cfusionmx\wwwroot\web-inf\public\SimpleMessage.java,
anyway this command gave this error,
C:\CFusionMX\wwwroot\WEB-INF\public>javac -classpath
%classpath%;c:cfusionmx\lib
\cfx.jar c:\cfusionmx\wwwroot\web-inf\public\SimpleMessage.java
c:\cfusionmx\wwwroot\web-inf\public\SimpleMessage.java:1: package
com.allaire.cf
x does not exist
import com.allaire.cfx.*;
^ etc....................
The compiler just doesnt know where the jar file is,
I don't understand either how com.allaire is being called in the package
reference either,
I dont know where com.allaire is coming from, I know about designing
packages, and if i'm right packages are directories,
well cfx.jar is sitting in cfusionmx/lib/ not com/allaire/
overall error, I do understand the falling errors are caused due the tag
having not been inplemented, well some!
javac SimpleMessage.java
SimpleMessage.java:1: package com.allaire.cfx does not exist
import com.allaire.cfx.*;
^
SimpleMessage.java:5: cannot resolve symbol
symbol : class CustomTag
location: class SimpleMessage
public class SimpleMessage implements CustomTag{
^
SimpleMessage.java:9: cannot resolve symbol
symbol : class Request
location: class SimpleMessage
public void processRequest(Request request, Response response)
^
SimpleMessage.java:9: cannot resolve symbol
symbol : class Response
location: class SimpleMessage
public void processRequest(Request request, Response response)
^
SimpleMessage.java:7: cannot resolve symbol
symbol : variable Local
location: class SimpleMessage
DateFormat
f=DateFormat.getDateInstance(DateFormat.FULL,Local.US);
^
5 errors
J
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4