Marcin Kurek

Greenhorn
+ Follow
since May 11, 2008
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 Marcin Kurek

Thank you for your responses! I guess I need to make some research
14 years ago
OK, so I'll clarify a bit. Let's assume that user want to send some data to the device.

As for now, I have a standalone java application which talks to hardware on specific port.
Using Flex app, one can make operations on the database as well as talk to device. In the first case, the RemoteObject is used, remote procedure is called, data is retrieved etc. In the second case, Flex app itself opens a socket connection to mentioned java app (yes, it also listens on another port) which in turn, forwards request to device. This is messy and I would like to get rid of that socket connection between Flex and standalone java app.
If I would be able to set up a socket server inside Tomcat, the whole thing would be a lot easier:
1. Device gets connected to the well known port of socket server. For each connecting device server spawns a separate thread.
2. User clicks "fetch client list" in Flex app.
3. Remote procedure is called, which executes socketServer.getClientList() and return result to Flex.

I hope this helps.
14 years ago
Hi there,

I'm building a system which consists of Flex frontend, Java + Hibernate + MySQL backend and an embedded device, which communicates using standard socket connection.
I'd like to be able to control the hardware from within Flex app.
I think it would be relatively easy if I could set up a socket server inside Tomcat. Is it possible? Even if so, is it considered as a good practice?
14 years ago
Hi there,

I am developing a simple application using JSF and Facelets, running on Apache Tomcat 6. At the main page I'm using nice JQuery based menu, found at http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/, which is the root of the problem.
Directory structure is as follows:

The problem is that these small arrows next to menu labels show up ONLY when I invoke application using http://localhost:8080/webapp address. Typing in http://localhost:8080/webapp/faces/home.xhtml brings home.xhtml page, jquery menu works fine, but arrows could not be loaded. As far as I know, when I type in http://localhost:8080/webapp the index.jsp is loaded. Because of <jsp:forward page="/faces/home.xhtml"/> request is redirected to JSF servlet, and in turn, http://localhost:8080/webapp/faces/home.xhtml is loaded (However, I'm not sure when exactly Facelets come to play).
So, at the first glance, the result of both operations should be identical, but it isn't. How could it be?
I think that possible cause of the problem may be the following line in menu's js file:
var arrowimages={down:['downarrowclass', "img/down.gif", 23], right:['rightarrowclass', 'img/right.gif']}

This js file is included in template, on which home.xhtml is based:
<script src="#{facesContext.externalContext.requestContextPath}/js/jqueryslidemenu.js" type="text/javascript"></script>

I think that because of some actions I'm not aware of, the paths to images may be incorrectly interpreted.
Moreover, when I click on either link in my menu, situation is exactly the same - destination page is loaded, but the arrows are gone.

Navigation rules at faces-config.xml are as follows:
<navigation-rule>
<navigation-case>
<from-outcome>home</from-outcome>
<to-view-id>/home.xhtml</to-view-id>
</navigation-case>

<navigation-case>
<from-outcome>about</from-outcome>
<to-view-id>/about.xhtml</to-view-id>
</navigation-case>
</navigation-rule>


Thanks for reading, if something is unclear please post, I'll try to clarify.
[ November 17, 2008: Message edited by: Marcin Kurek ]
15 years ago
JSF
Gregg,

I could create new option this way:

Document.forms['myform'].testselect.options[0] = new Option('new text','new value');

But the point is that I need to get data from the database.
OK, so let's suppose I have three selects generated on page load, thus populated with data. Two of them are hidden by default. What happens if I don't click "Add" link and submit the form? I believe the hidden selects are submitted too. But at the servlet logic I need to distinguish them somehow.
For example:
Select 1 (visible)
- attribute 1
- attribute 2 (selected by user)
- attribute 3
Select 2 (hidden)
- attribute 1 (selected by default)
- attribute 2
- attribute 3
At the servlet code, how do I know that Select 1 was selected by user and Select 2 wasn't even visible, so it does not need processing?
Hello,

I've been googling for a while but still can't find solution to my problem.
I would like to have a jsp page with a form consisting of several inputs and selects. When page loads for the first time, there is only one select (with values taken from database), but after clicking on link "add", the subsequent selects are added (using JavaScript and DOM). It seems to be pretty easy task, but I'm not sure how to populate the newly created select with data.

Thanks!