Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Sam Doder

Ranch Hand
+ Follow
since Feb 06, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 Sam Doder

I am using struts2 framework

And everything works fine when I have my actions tags / result tags in the struts.xml file not using tiles
when I start sectioning code off into tiles I cann't retrieve that data any more

for example
<c:forEach var="myvar" items="itemlist" > ....etc myvar.propertytopopulate comes back as null always when using tiles.

But when I have it just a <result name="success" > myjsppage.jsp ...etc </result> in the struts.xml works fine


What could be going wrong ? I even tried request.getSession().setAttribute(...) but it still doesn't work.
I am think it must be some scope issue but I cann't figure it out.

Tiles are acting werid interms of scope and accessing data

My action tags are <action name="myactionsname" class="com.myclass...etc" method="sometimestomakeitdifferentfromdefaultexecutemethod" >
<result name="success" > ...etc </result>
</action>
7 years ago



Feel free to move this code into the examples section of java ranch moderators.
Hope you enjoy
8 years ago
I figured most of it out

1) is add server_args = -f --allow-root /var/lib/cvs --allow-root /var/lib/cvsnextone --allow-root /var/lib/cvsanotherrepo pserver then restart xinetd

2) add another config file in /etc/xinetd directory for a second cvs service and set the port to something different then the default 2401. Then restart the xinetd service.

So those 2 questions are solved

But the 3 one is a problem for me
Because whenever I check in stuff under a given user it commits it with user and group to be the same?
For example I have cvsguy1 and cvsguy2 each are in the cvsgroup and the repo's owner=nobody , group=cvsgroup chmod= rwxrwx---
Why is it when ever I commit something with cvsguy1 the folder owner/group is cvsguy1/cvsguy1? I want it to be cvsguy1/cvsgroup ?

The problem then becomes cvsguy2 is not in group cvsguy1...

How do you set the default group that the user checks in stuff as? (I don't want to always have to chgrp on each folder after the fact )
8 years ago
Hi,
I have setup cvs with xinetd. My config file for it is


From this you can see that my cvs root repository is located at /var/lib/cvs
I have made the /var/lib/cvs owner=cvsgroup group=cvsgroup and permissions are drwxrwx--- So only users that are add to the cvsgroup can access the repository.

3 Questions

1) say I have created another repo at location /home/morerepos same own/group/permissions as /var/lib/cvs. Is their some way I can add the /home/morerepos to the configuration file above so that they both can be used as repo locations when I restart the cvs service.

2) Is it possible to start to different cvs services each running on different ports?

3) Is their away to restrict a particular user to a few particular projects so that he can only check in/out on those projects in my repo?
Note is their away without have to alter the group of a project since I have tons of users already accessing that project under the group cvsgroup rwx but I only want some users to have "r" or "rx" permissions. Basically what is the easiest way to have complete control over all my users.
8 years ago
Thanks didn't know that all set
8 years ago
No, just trying to get a program to look the same on any platform/machine out their. (Regardless of weather it is x11 , or windows )

startx -- : 1 ,2,... , ctrl+alt+f7,8,9,...

8 years ago
cool,
also is it possible to get a LAF on linux that looks exactly like xp or vista running under gnome? Or is the look and feels for java gui programs (or maybe even more general any gui program)
restricted to the look and feels of the desktop/windows manager you are under?

If it is restricted to the desktop/windows manager that is running on your linux system then the only way to get a windows look and feel on a linux system is to install a desktop/windows manager that can look like a windows system one. Assuming of ofcourse your not running your java or gui program on wine , virtualbox or any other virtual based tool that emulates another system.
Yes /No?

Question 2
Is their anyway to create your own theme or look in feel under linux? Like in ubuntu I can go to the desktop properties and select from a whole bunch of different themes , colors , fonts ,...etc.
Is their away to create your own or import/get a new them that looks exactly like windows 7 or something else???
8 years ago
I have programmed using GTK++ , and QT with X11 libraries on linux based machines.

What I am trying to understand is what does java call to make it's gui.
What I mean is say you have a JFrame and setVisible ...etc so it pop's up a gui Frame box.

How it works in windows is when you install java it comes with dll's for awt and swing that call the win32 api's graphics/windows gui functions
I am wondering what java on linux does , is it just shipped with the equivalent awt.dll but as awt.so library that calls the x11 libraries.
I am assuming these dll's that where used for windows and the source that generates them would need to be completely rewritten and recompiled for a linux gui functions on a linux machine

Also is the native functions that JFrame and other gui java stuff uses calling desktop manger gnome functions , windows manager functions or more general x11 top level functions.
Since if you change the desktop manger or windows manager it seems to change the JFrame look and feel?

Wondering if anybody knows the inner workings of this and can elaborate
8 years ago
Ya , I cann't really make it completely out at some of these sites since they are using external files for their js functions that I am not able to easily view the complete code.
But it looks to be like I am saying with ajax functions to store the image in a tmp directory and then use ajax to get the image and set it on the page.

All I was really wondering now is if you must submit the picture even before the form is submitted? If that is the case then ajax will work for me and I am sure in flash their is an ajax equivalent functions to do simlar tasks.

I remember when I could get the complete src path of a file thru javascript , windows script hosting , or vbscript on the client machine but those ways would never work well with todays web security enforced in most peoples browsers by default.

Just need somebody to confirm for the last time that you must upload before displaying thumbnail picture.
8 years ago
JSP
So you are saying that all website that have you upload an avatar or picture and display it's thumbnail picture before the submission of the form. Are really uploading the picture to their site before the submission of the form?

And so if you cancel / get out of the page and not submit they still have your picture.
Correct me if I am miss understanding.

Is this the only way or does their exist another way?

If this is the only way I would have to submit the picture before the form. Curious what the best way of going about this. Probably some ajax.
8 years ago
JSP
Ok , the apache one works well for uploading images and texted. (all set with that one)

My last question is I have an <input type="file" ... /> tags I want to put a clickable image in it's place that does the same thing but shows the image before submitting the form (like some websites do)

I want to know how I can create a picture I can click on to upload a file /image but when they upload the image how does some websites display the images picture before the form is submitted.
I was thinking this is some client side code like javascript.

I can easily write javascript code that when you click on an image it pops up a upload dialog box. By just makeing the <input type="file" .../> hidden and then writting javascript so onclick of the image it clicks the hidden input file tag. But I am stuck because I cann't seem to get the complete path to their file. So I cann't set the src of the image using javascript because I get c:\fakeroot problem?
8 years ago
JSP
Ya, I can testify to that because I was starting to parse thru the getInputStream by ----Web.....etc delimiter words ,...etc etc not fun.
Thanks for the code guys I think I will use it or getPart for j2ee 1.6

What is the O'Reilly library one that you are talking about (link please )

And would it be safe to say that these libraries apache/o'reilly have been around since the time the internet had forms that you could upload files on submit of an html page.





8 years ago
JSP
ok , curious how did people use to code it before the apache library and servlet 3.0 was available?
8 years ago
JSP
Ok, question if I use apaches functions to get the file contents (i.e like the code above) will I still beable to use getParameter for getting other parameters from the form such as text?

And if I use the j2ee api (servlet 3.0) I believe getParts would get me the content but can I still use getParameter with it to get the other parameters like textfields ,...etc

Don't want to run into the problem of not being able to use getParameter.

Also as you have said servlet 3.0 contains a built in function to get it (are you talking about getPart or something different)


8 years ago
JSP
Ok , what I am trying to do is get an image from the form I submit and store it in a database. (don't ask why or you should store it not in a database just a directory)

<input type=file ...> is on my form and when I click the submit button I can use getParameter to get the value of my text based fields , checkbox's ,...etc
But when uploading a file ... It just gives me the name of the file not the contents.

So I need away to get the contents of this upload ,i.e the binary.

So then I tried the function response.getInputStream and I was able to write a simple parser that extracts the image from the html body submitted data and allows me to write it to a database as I wanted.

My problem now is I will have to parse thru all the other fields that I could easily have gotten from using getParameter....

Since the java doc clearly say you can use only one or the other getParameter , getInputstream .

So I am stuck between a rock and a hard place since my parser will probably not be portable for many different webserver if I host it on different sites/computers.

Is their anyway of using getParameter to get my fields like normally and some other function to get the binary/contains of the uploaded file so I can write it into my databases BLOB filed for the images.
Without having to use just getInputStream and write a parser each time to get contents of an uploaded file?

I have been using j2ee 1.5 but I have noticed that j2ee 1.6 has a getPart function. Wondering if that function is the one that will do what I want. I would be willing to upgrade to that if it is true.
Does anybody no for sure?

Also if I can use getParts to do it then can it be used with getParameter at the same time or am I stuck with using one or the other.

8 years ago
JSP