Alan Jackson

Greenhorn
+ Follow
since Oct 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alan Jackson

Thats what Im looking for.

Can you point me in the right direction of what I'd need to do server side to implement this?
11 years ago
JSP
This might be the wrong place to post this (its been almost 10 years since Ive done any coding).

Im looking to have a web page that displays an image or video. I want to have a URL include the image name or ID. When my web page is reached, it takes the variable from the link that was clicked and then loads that video.

Can anyone point me in the right direction?
11 years ago
JSP
Got it working, thanks Gregg
18 years ago
Thanks very much. What would the someClass bit you mentioned refer to?
18 years ago
Is this for Brian Hainy's coursework? If it is you are a cheating sod!


but see here Application.java

18 years ago
Hi Guys.

I have a java program thats works with an LDAP server. Basically, it gets some values, and outputs them to the dos console window. Problem is, I want them to go to the JTextArea on the GUI.

I have one method that creates the GUI, one that acts as actionPerformed (when I push the connect button) and then methods for getting the info I need. What I need to do is in the methods that get the info, I need to write to the text area. But because it is private I cant do it.

Anyone know how I can write to a private JTextArea from another method?

Cheers!
18 years ago
Just a quick question about accessing an ldap server.

Im trying to list all the attributes from a server. The address of the one Ive been using is "ldap://ldap.utexas.edu/o=The University of Texas at Austin,c=US"

My code access te server but only lists the first element (which is an ou). How do you either count the attributes in the server or keep going until all have been listed? My code is below. Id really appreciate a response.

while (answer.hasMoreElements()) {

SearchResult sr = (SearchResult)answer.next();
System.out.println("\n>>>" + sr.getName());
this.displayJTextArea.setText(displayJTextArea.getText() + "\n" + sr.getName());
//printAttrs(sr.getAttributes());

if (sr.getAttributes() == null) {
System.out.println("No attributes");
this.displayJTextArea.setText(displayJTextArea.getText() + "\n" + "No attributes");
} else {
try {
NamingEnumeration ae = sr.getAttributes().getAll();
while (ae.hasMore()) {
Attribute attr = (Attribute)ae.next();
System.out.println("ATTRIBUTE: " + attr.getID());
this.displayJTextArea.setText(displayJTextArea.getText() + "\n" + "ATTRIBUTE: " + attr.getID());

NamingEnumeration e = attr.getAll();
while (e.hasMore()) {
System.out.println("value: " + e.next());
this.displayJTextArea.setText(displayJTextArea.getText() + "\n" + "value: " + e.next());
}
}
} catch (NamingException e) {
e.printStackTrace();
}
}


}
18 years ago
Help!

Im really pressed for time, and need to loop round an int array to see if any of the values appears more than once.

For example, I need to check that the number 5 is in element 0 only. Can anyone help?

Im appreciative of all assistance!
19 years ago
I am wanting to return a boolean, and have a long passed out too. My idl file looks like:

boolean return (in long long onelong, out long long twolong);

How do I work the out parameter? I know I need to use a holder, but Im having trouble grasping the concept. Ive been using java.sun.com/developer/ technicalArticles/Servlets/corba/ for help but Im still not having any luck.

Can anyone offer some help?
19 years ago
How does the AssertTrue function work?

I have AssertTrue("error",variableboolean1); which to the best of my knowledge should work. Do I need to import something or do something to make it work?
19 years ago
Hi,

Im new to distributed java, and Im currently working with some CORBA stuff and Im needing some help.

Im trying to pass in a hard coded long and have it sent back as a string with a little bit of text after it. My code is shown below. Im always getting a problem with my Operations file produced with "(greeting.sayHello())" as the problem - "sayHello(long) cannot be applied.

Im sure its just some way Ive defined something, but Id really appreciate it if someone could help me out.

IDL:
------
interface Greeting {
string sayHello(in long long msg);
};


CLIENT:
--------
long msg = 2;
Object nameService = orb.resolve_initial_references("NameService");
NamingContext nameCtx = NamingContextHelper.narrow(nameService);
NameComponent [] name = {new NameComponent("MyGreetingServant", "")};
Object servant = nameCtx.resolve(name);

Greeting greeting = GreetingHelper.narrow(servant);
System.out.println(greeting.sayHello());
} catch (Exception e) {
System.out.println(e);
}
}
}


SERVER
--------
public static void main (String [] args) {
try {
ORB orb = ORB.init(args, null);
GreetingImpl greetingServant = new GreetingImpl();
org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");
POA poa = (POA)obj;
poa.the_POAManager().activate();
org.omg.CORBA.Object greetingObj = poa.servant_to_reference(greetingServant);


org.omg.CORBA.Object nameService = orb.resolve_initial_references("NameService");
NamingContext nameCtx = NamingContextHelper.narrow(nameService);
NameComponent [] name = {new NameComponent("MyGreetingServant","")};
nameCtx.bind(name, greetingObj);

orb.run();
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
}


IMPL:
------
public class GreetingImpl extends GreetingPOA {
public String sayHello(long msg) {
String mess;
mess = (msg + "from Impl");
return mess;
}
}
19 years ago
This is a simple question but Ive never had to do it so Im looing for some info.

Im using the jsdk 1.3.1 and need to upgrade (having problems with POA in my CORBA apps) so I was wondering, do I need to reinstall my java runtime stuff and reinstall it again or is there a simple updater program?

Any links/info would be appreciated.
[ December 01, 2004: Message edited by: Alan Jackson ]
19 years ago
Im using some code to list the contents of a directory as a string, and Im wanting to add in some fail safes.

How would I go about checking if the directory exists first of all? If it doesnt exist, I want to output a message saying it doesnt exist.

Similarly, if the directory is empty I want to ouput that too.
19 years ago
I was wondering, how does type collection work? If Im wanting a list of files returned as a collection, how would I do it?
19 years ago
Ive got a small client/server running, which asks for a filename, and then passes the filename to the server. If i hard code the filename it works fine, but the second I use keyboard.readLine() I get several errors, including:

junit.framework.AssertionFailedError: java.lang.NullPointerException
19 years ago