« Return to Thread: DWR - obtaining a path in remote method
I solved this problem with some dwr stuff... here's how. Turns out it didn't solve my ultimate problem however.David Marginian-3 wrote:Have you tried using the FacesExtensionFilter? I don't use JSF but it
looks like this may give you access to the FacesContext:
http://directwebremoting.org/dwr/server/jsf
Depending on what version of DWR you are using the docs may be outdated,
the package of the filter has changed:
org.directwebremoting.faces.FacesExtensionFilter
Look at the source of the class to see if it will help you out.
JBuilderDoug wrote:
> I have a retrieve button on my form that calls a javascript that sends a
> request back to my application on the server. The server method gets
> information from a MySQL database and sends it back as a string [] to the
> javascript. The java script parses the string and populates fields on the
> form. All well and good.
>
> Now I need for the server method to retrieve the text data and also retrieve
> and image (BLOB) from MySQL, write it to a file, then send the filename back
> with the other text data for display.
>
> My problem is that (I'm using JSF) that the DWR method in my application on
> the server is not privvy to FacesContext (which makes sense). My directory
> is images/<filename>, but that's a relative path. If I wrote to
> images/<filename>, it would try to write to an "images" directory under
> glassfish\bin (since I'm deployed under glassfish) and that's the literal
> current directory.
>
> I need to get the real path to write the image file (something like
> c:\glassfish\domains\domain1\autodeploy\<my app name>\images.
>
> Then what I can pass back to the javascript is simply images\<filename>
>
> Surely, there's some context I can hook into once the javascript gets back
> to the server?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dwr.dev.java.net
For additional commands, e-mail: dev-help@dwr.dev.java.net
« Return to Thread: DWR - obtaining a path in remote method
| Free embeddable forum powered by Nabble | Forum Help |