Help coderanch get a
new server
by contributing to the fundraiser

Andreas Sandberg

Ranch Hand
+ Follow
since Sep 14, 2005
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 Andreas Sandberg

Hi Folks,

I'm writing a J2EE application where a user authenticates using LDAP. The authentication is no problem but now I'm trying to get more information about certain users. Specifically I need to get list of employees that works for a certain manager. Our LDAP schema here has a 'reportsTo' field somewhere but when I list all of the attributes for a certain user, the field is not listed. I think it's hidden in another object which is embeded in an attribute. I don't have the slightest clue as to how to pull the information out. I've tried simple searches and they work but the 'reportsTo' field is still missing. Looking at our LDAP schema, it appears that the field is available in the ObjectClass "EmailPerson". Does anybody have any idea how I can get this value? I read through some tutorials and explanations but am still lost. I'm also running short on time and don't have the luxury to really learn all this at the moment. Any help is greatly appreciated. Thanks!

andreas

Here is my current code which returns nothing for the reportsTo field:


[ August 31, 2006: Message edited by: Andreas Sandberg ]
Hi Guys,

I currently have an application I'm working on where users add work log entries through a standard form. They can add multiple entries and then click save which adds the entries to a database. While they are adding new entries they can view all their old entries and delete or update any of them. I'm currently storing all of these entries through a servlet in a vector and adding them to a particular user through the session API, but I'm wondering if I shouldn't do this through a bean method? I currently have a bean setup which validates all of the entries. If the validation is true I then pass the request to a servlet which stores the entries in a vector. Should I transfer this control to a bean? If I do, how can I ensure that each user logged into the system gets their own bean and that other users aren't accessing other peoples bean's? I set the scope of the bean to a session scope so I'd imagine that the bean will remain with that particular user but I just want to be on the safe side! Thanks so much.

Andreas
18 years ago
Hi Bear,

When you mention web app structure do you know of any good tutorials or reading material? I've gotten jsp's and servlets down pretty good and do have my application working. From a design point of view though I'm not very happy with it as I feel it's a bit sloppy, even though I've tried to implement things according to the MVC model 2 design pattern. I have a main servlet acting as a request dispatcher but the way I'm making my calls to the database is very ugly. Thanks!!!

Andreas
18 years ago
Thank you! I will look into using hibernate and spring and this seems to be a fairly popular choice at the moment. Any opinons regarding struts? So much to learn, so litle time Thanks again.

Andreas
18 years ago
Hi Folks,

I'm working on project and have a design question I was hoping I could get help with. Basically, I have created a small application that about 200 users will be using to input work log information. The main page allows the users to submit information and the information is then displayed back to the user on the same screen so they have the option to see what they've submitted and make updates. They can of course continue to enter new information. (Basically just adding continuously to a table) I'm wondering what the best way is to handle how to store the user input. Right now the validation is all done with JSF and then I forward the response to a servlet which stores all the input within a vector. The vector is stored as a session object. When the user clicks save, the vector is saved to the database. This doesn't seem like the most elegant way to handle the situation and I'm wondering if I should use a bean or perhaps even an EJB? I'm new to J2EE and there has been a lot of information to take in, especially in such a short amount of time so any advice/input is appreciated. THANKS!!!

Andreas
18 years ago
Hi Folks,

Not sure exactly what is happening here but I hava fairly simple problem (should be). I'm trying to process a form which contains two text input fields using a jsp file. Everything works correctly when submitting the form with GET yet when I switch to POST I only get null values. The form is displayed from apache v2.2 which then redirects the request to a tomcat virtual url :8080/skynav which is running from tomcat 5.5. The web.xml defines the welcome file as project.jsp. Is there a meta tag that I'm forgetting to use to encode the text. Some code below. Your help is appreicated. Thanks!!!

Andreas




18 years ago
JSP
Folks,

I'm creating a Java App using swing and had a quick question. Does it make more sense when creating a frame to extend the JFrame class or to create a new JFrame object in the constructor of the class that will provide the gui? I don't need to extend any other classed by this gui class so I'm not worried about that but rather what makes sense from a strictly OOP design viewpoint? By extending the JFrame class I should be creating a more specific JFrame class. However, I'm not really adding any functionality (technically), I'm just painting some objects. Thanks for your input.

Andreas
18 years ago
Hi Folks,

I'm currently working as a program manager for a large computer company and miss the technical side of things. I'll be taking the Programmers exam next week and have a degree in Computer Science from San Jose State University. I'm looking for an entry level developer position. Hard working, honest, and willing to learn whatever it takes. Please message me and I will gladly furnish my resume. Thanks for your time.

Andreas
18 years ago
Hi Folks,

According to A Programmers Guide to Java Certification, second edition, by Mughal and Rasmussen, the authors state on Page 226 that "private members of the superclass are not inherited by the subclass". This makes sense to me but then I was reading the JAVA tutorial by Sun and they said this:


For example, a subclass cannot access a private member inherited from its superclass. One might say, then, that the item was not inherited at all. But the item is inherited. This becomes important when using an inner class, which does have access to its enclosing class's private members. Note that constructors are not members and so are not inherited by subclasses.



So, anybody know who's right? Thanks!

Andreas
Sun Tutorial
Well,

I removed the package statments from the two java files and everything wokrs fine now. For some reason I kept the java files in the following directory:

/home/andreas/tmp

and had the package statement set in both source files as :

package home.andreas.tmp;

Anybody have any ideas as to why this would be a problem with running the command "java -classpath . Main"

Thanks!
18 years ago
Thanks Ernie, I'm still having some issues. I find it strange that running: 'java fakeclassname' only produces the output NoClassDefFound yet when I invoke 'java Main' I get the stack trace. By the way, I can still run the class file with the .jar file from the netbeans IDE on the command line yet when I unzip the .jar file and try to run java on the main class it blows up.
18 years ago
Folks,

I'm pulling my hair out trying to figure this out. I'm creating a program using the Netbeans IDE and was gong to send off the class files to a friend so they could run the program. So I just wanted to make sure I could get the program to run on the command line. For some reason I can compile and run the program within the IDE but when I try on the command line I get the following message after runing "java -classpath . Main" :



My classpath contains the directory the files are located in and the current directory '.'

Does anybody have any idea as to why this is happening? I feel rather retarded. Thanks.

Andreas
18 years ago
Hi Folks,

Can somebody explain why the code below compiles. Why does Main a = new Main(3) call the constructor that takes the float argument. How does JAVA handle implicit promotion for constructor arguments? Thanks!

Don't forget, there are also rules about automatic implcit narrowing promotion.

Fore example.

byte b = 3; //Ok,

int i = 3;
byte c = i; //Not ok, not resolved at compile time.


So for implicit automatic promotion the following apply:

a) The operand to the right of the assignment operator must be a byte, char, short, or int.
b) Operand on the right must be in the range of the operator on the left
c) Operator on the left must be a byte, short, or char.

Anything else required an implicit cast.

int x = 3L; //Compile error, need a cast

int x = (int) 3L; //OK.
Muchos gracias. Still think it would make sense to compare two reference types with the instanceof operator and have it return false rather than a compile time exception though.


a