[Lift] Re: different apps -- same session data
Thanks for the quick reply. I think it points me in the right (ie. different than what I was thinking) direction. I don't have an authentication server (yet), so my apps would all be under Glassfish or Jetty on the same server. So I'm off to read about JSESSIONID with these containers now. Rog On Jan 28, 3:09 pm, David Pollak wrote: > On Thu, Jan 28, 2010 at 11:45 AM, Rogelio wrote: > > Hello, > > > Admitted Scala and Lift newbie here. I've been searching and reading > > (Lift book and this newsgroup about 10 times day :-) about how to do > > this for over a month and have yet to find an answer (or at least one > > that I recognized :-) This list seems very friendly to us newbies, so > > here goes. > > > I'm wanting to create a web portal for use at work. On the main page > > the user will login and from there (based on user roles) the user can > > access other web applications running on the same or different servers > > but within the same domain. > > > So user goes to:https://portal.mycompany.comand logs in. From there > > the user can go to: > > > portal.mycompany.com\app1 > > portal.mycompany.com\app2 > > > or maybe/additionally > > > app3.mycompany.com > > app4.mycompany.com > > > If the user tried to go to app1-4 directly (without having logged in), > > they are directed to the main portal page to login first. > > > So, I know I need some sort of session data that app1-4 code can > > reference to see if the user is logged in. I have tried this in Rails > > (that's my web dev background) and just need to add this to the config > > file to have separate apps be able to access the session data for the > > domain a a whole: > > > ActionController::Base.session = { > > :domain => '.mycompany.com' > > } > > > Question is -- how to do this with Lift? I would like to ask for some > > actual code if I may -- 1) because I'm a newbie and 2) I suspect that > > the answer may be because Lift uses the container's session support > > (Glassfish, Jetty, etc) which I'm still trying to understand the > > underlying link between them and Lift. > > If all the apps are sharing the same app server then it's up to your > container to set the JSESSIONID cookie correctly for all the subdomains. > > If you have an authentication server and each of the different URLs is in > its own container, then you'll have to use a mechanism similar to the one > used in ProtoExtendedSession to share a cookie across the different app > servers and look up the user based on the cookie. > > Does this help? > > > > > > > Thanks in advance for the help. > > > Rog > > > -- > > You received this message because you are subscribed to the Google Groups > > "Lift" group. > > To post to this group, send email to lift...@googlegroups.com. > > To unsubscribe from this group, send email to > > liftweb+unsubscr...@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/liftweb?hl=en. > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Surf the harmonics -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] different apps -- same session data
Hello, Admitted Scala and Lift newbie here. I've been searching and reading (Lift book and this newsgroup about 10 times day :-) about how to do this for over a month and have yet to find an answer (or at least one that I recognized :-) This list seems very friendly to us newbies, so here goes. I'm wanting to create a web portal for use at work. On the main page the user will login and from there (based on user roles) the user can access other web applications running on the same or different servers but within the same domain. So user goes to: https://portal.mycompany.com and logs in. From there the user can go to: portal.mycompany.com\app1 portal.mycompany.com\app2 or maybe/additionally app3.mycompany.com app4.mycompany.com If the user tried to go to app1-4 directly (without having logged in), they are directed to the main portal page to login first. So, I know I need some sort of session data that app1-4 code can reference to see if the user is logged in. I have tried this in Rails (that's my web dev background) and just need to add this to the config file to have separate apps be able to access the session data for the domain a a whole: ActionController::Base.session = { :domain => '.mycompany.com' } Question is -- how to do this with Lift? I would like to ask for some actual code if I may -- 1) because I'm a newbie and 2) I suspect that the answer may be because Lift uses the container's session support (Glassfish, Jetty, etc) which I'm still trying to understand the underlying link between them and Lift. Thanks in advance for the help. Rog -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] dynamic search criteria
I'm working on my first Lift project. I'm implementing a search form that will have several fields -- firstname, lastname, age, sex, state, etc. The search should allow the user to enter as little or as much information as they know in order to narrow the search down. So, if they know the lastname is "Smith" and he is "Male" then the search should show all males with last name smith. If the user does another query on smith, Male, and now adds age=50 and state="FL", then it should return the new, more specific query results. Question is, how to implement this dynamic search in a safe way (ie, avoid SQL injections etc). I'm thinking about using BySQL, but am unsure how to do ("where name=? and sex=?", "smith", "Male") and the next time have it be ("where name=? and age=? and state=?", "smith", 50, "FL") Basically, how does one safely generate the varying number of conditions? Thanks in advance, Rog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] lift and mysql
Hi All, I'm new to Lift so forgive me if this is old news -- I did not see this info in a search of the group archive. I've been trying to get Lift to work with MySQL following the instructions on the wiki: http://wiki.liftweb.net/index.php/HowTo_configure_lift_with_MySQL I kept getting an error that "Can" was an unresolved symbol in line 2 of this section of code: object DBVendor extends ConnectionManager { def newConnection(name: ConnectionIdentifier): Can[Connection] = { try { Class.forName("com.mysql.jdbc.Driver") val dm = DriverManager.getConnection("jdbc:mysql://localhost/name- of-your-database?user=root&password=mysql-password") Full(dm) } catch { case e : Exception => e.printStackTrace; Empty } } def releaseConnection(conn: Connection) {conn.close} } I found that if I replaced the word "Can" with "Box" (ie Box [Connection]), then I was able to get the wiki instructions to work. I also has to preface the two import statement in the wiki with "_root_." So far it appears to work, but others with more experience may want to weigh in. Thanks, Rog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] lift and background processing
Hi, New to the forum and new to Scala/Lift. In a previous Ruby Rails project, I needed to generate some PDF files on the fly in response to a user clicking a link. For that, I passed the task off the a worker with BackgroundRb so that the mongrel instance would not be tied up for a long time. I then used Ajax calls to update the user's webpage when the pdf was ready. I'm considering Scala/Lift for my next project but am unclear how something like this would be done. I've read about Actors and concurrency but the examples I've seen have been for passing simple message (stock quotes or something) and not for starting a long running process like connecting to a MySQL DB and generating a PDF report. Should I even be looking at Actors for this? Is Comet that is integrated into Lift a possibility? Basically, how does something (not necessarily PDF generation, but any long running process that user could request) like this get done with Lift/Scala? I'm thinking I would have to have Scala use the IText pdf library perhaps. I don't need to have thousands of background threads generating PDFs, but it should be able to handle say 50 before it starts queueing up the PDF requests (ie, I don't want a simple first in first out as that could take to long for the user to get results). Thanks for you advice and patience with newbie questions. Rogelio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---