Search Results

Search found 696 results on 28 pages for 'servlets'.

Page 23/28 | < Previous Page | 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • HttpSession problem in Google App Engine/J

    - by Tahir Akram
    I am writting a Twitter web app by using Twitter4J on GAE/J. I am saving Twitter and Request Token objects in session so that to be used after call back. I have two servlets. IndexServlet sets session and HomeServlet get from session (hits on call back by twitter oAuth). If I comment out session handling lines in both servlets then call backs works fine. Please suggest any workaround. I am sharing my code here. IndexServlet.java Twitter twitter = new Twitter(); twitter.setOAuthConsumer("<masked>", "<masked>"); RequestToken requestToken = null; try { requestToken = twitter.getOAuthRequestToken(); log.info("OAuth token has been taken"); } catch (TwitterException e) { log.warning(e.toString()); } HttpSession session = request.getSession(); if (session.getAttribute("twitter")==null){ session.setAttribute("twitter", twitter); out.println("-----------------------------> session is set"); } if (session.getAttribute("token")==null){ session.setAttribute("token", requestToken); out.println("-----------------------------> session is set"); } String authUrl = requestToken.getAuthorizationURL(); HomeServlet.java HttpSession session = request.getSession(); twitter = (Twitter)session.getAttribute("twitter"); r = (RequestToken)session.getAttribute("token"); twitter.setOAuthAccessToken(r.getAccessToken()); twitter.updateStatus("Hello World!"); Exception javax.servlet.ServletException: java.lang.ArrayStoreException: [Ljava.lang.String; at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:239) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4950) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4948) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359) at com.google.net.rpc.impl.Server$2.run(Server.java:823) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)

    Read the article

  • How to read attachment messages without using scriptlets in JSP?

    - by Stardust
    Hi, I want to know how can I read attachment messages without using scriplets in JSP? After getting Message object as an attribute by using request object from servlets, how can I confirm whether Message content is an instance of Multipart or not without using scriplets like: if(message.getContent() instanceOf Multipart) How can I read the content of any file by using EL in JSP? As I can't see any getRead method in inputStream subclass.

    Read the article

  • How to get UTF-8 working in java webapps?

    - by kosoant
    I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ??? for special cases. My setup is the following: Development encironment: Windows XP Production encironment: Debian Database used: MySQL 5.x Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site. How to achieve this?

    Read the article

  • Book recommendation for developing ecommerce website in Java

    - by Mirage
    I have seen that there are many books titled: Build Ecommerce website in php Build shopping carts in php or asp.net Is there any book which explains, from scratch, how to start building a website in Java using any framework or with servlets or JSP? Desired topics: Basic forms with logins and registration Building catalogue system Building shopping cart Building newsletters system

    Read the article

  • Simple but good pattern for EJB

    - by Sara
    What would you suggest as a good and practical but simple pattern for a soloution with: HTML + JSP (as a view/presentation) SERVLETS (controller, request, session-handling) EJB (persistence, businesslogic) MySQL DB And is it necessary to use an own layer of DAO for persistence? I use JPA to persist objects to my DB. Should I withdraw business logic from my EJB? Sources online all tell me different things and confuses me...

    Read the article

  • Best Method for "Back Button"

    - by CitadelCSCadet
    I'm working on a web application using JSP/Servlets, etc. And I have a lot of form progression. I am aware of some ways to use the "Back" functionality, but I am not sure if its efficient enough. What are the best ways to implement this? Does it Involve using the session object? or just the request? or neither?

    Read the article

  • Best way for user authentication on JavaEE 6 using JSF 2.0?

    - by ngeek
    I'm wondering what the current state of art recommendation is regarding user authentication for a web application making use of JSF 2.0 (and if any components do exist) and JEE6 core mechanisms (login/check permissions/logouts) with user information hold in a JPA entity. The Sun tutorial is a bit sparse on this (only handles servlets). This is without making use of a whole other framework, like Spring-Security (acegi), or Seam, but trying to stick hopefully with the new Java EE 6 platform (web profile) if possible. Thanks, Niko

    Read the article

  • Should I add try/catch around when casting on an attribute of JSP implicit object?

    - by Michael Mao
    Hi all: Basically what I mean is like this: List<String[]> routes = (List<String[]>)application.getAttribute("routes"); For the above code, it tries to get an attribute named "routes" from the JSP implicit object - application. But as everyone knows, after this line of code, routes may very well contains a null - which means this application hasn't got an attribute named "routes". Is this "casting on null" good programming practice in Java or not? Basically I try to avoid exceptions such as java.io.InvalidCastException I reckon things like this are more as "heritage" of Java 1.4 when generic types were not introduced to this language. So I guess everything stored in application attributes as Objects (Similar to traditional ArrayList). And when you do "downcast", there might be invalid casts. What would you do in this case? Update: Just found that although in the implicit object application I did store a List of String arrays, when I do this : List<double[]> routes = (List<double[]>)application.getAttribute("routes"); It doesn't produce any error... And I felt not comfortable already... And even with this code: out.print(routes.get(0)); It does print out something strange : [Ljava.lang.String;@18b352f Am I printing a "pointer to String"? I can finally get an exception like this: out.print(routes.get(0)[1]); with error : java.lang.ClassCastException: [Ljava.lang.String; Because it was me to add the application attribute, I know which type should it be cast to. I feel this is not "good enough", what if I forget the exact type? I know there are still some cases where this sort of thing would happen, such as in JSP/Servlet when you do casting on session attributes. Is there a better way to do this? Before you say:"OMG, why you don't use Servlets???", I should justify my reason as this: - because my uni sucks, its server can only work with Servlets generated by JSP, and I don't really want to learn how to fix issues like that. look at my previous question on this , and this is uni homework, so I've got no other choice, forget all about war, WEB-INF,etc, but "code everything directly into JSP" - because the professors do that too. :)

    Read the article

  • good Book for learning JSP practically

    - by persistence
    hi I am new to JSP. I wish to learn JSP with more of practical approach. I have already gone through "Head First JSP and servlets"...but it is more dedicated towards SCWCD... so this time i wish to take sugesstion before picking up a book... I need a book with is much more of practical approach... covers traps in JSP.... thanks.

    Read the article

  • Guide need to build a JSP based webapplication

    - by Nick
    I want do a web-application that consists of the following pages: Main, Inventory, Shopping, Login, and Report. All will be JSPs and all will be called using the MVC pattern where one of two servlets uses the RequestDispatcher to call the appropriate JSP. This uses server-side forwarding and not redirection. I have ER diagram: http://tinypic.com/r/155oxlt/5 if u can guide I can do it successfully.

    Read the article

  • What do you expect of an 'Experienced Developer'?

    - by ritu
    I have been programming for about 10 years: 7 years C++, 3 years MFC, 2 JSP/Servlets, and the last year .NET (since there was some overlap the total won't add up). The problem is now that I am looking for a new job, I don't know what the latest thing is in C++ AND Java AND .NET AND MFC and somehow at interviews I am expected to KNOW everything about these topics because I have them listed on my resume. Any suggestions?

    Read the article

  • regarding port forwarding

    - by giri
    Hi I have designed a chat application using servlets and jsp. I do not like it to host on any web hosting sites. I wanna make my computer only as server and wanna make it accessible to the users of different network. Can anybody explain me how can this be achieved. I will be really thankful. I was said that use port forwarding how can this be solved using port forwarding?

    Read the article

  • calling a java servlet from javascript

    - by marco
    Hello, I am trying to create a web application using the MCV design pattern. For the gui part I would like to use javascript. And for the controller Java Servlets. Now I have never really worked with javascript, so I'm having a hard time figuring out how to call a java servlet from javascript and how to get the response from the servlet. Can anybody help me out?

    Read the article

  • GWT-RPC vs HTTP Call - which is better??

    - by Nirmal Patel
    I am evaluating if there is a performance variation between calls made using GWT-RPC and HTTP Call. My appln services are hosted as Java servlets and I am currently using HTTPProxy connections to fetch data from them. I am looking to convert them to GWT-RPC calls if that brings in performance improvement. I would like to know about pros/cons of each... Also any suggestions on tools to measure performance of Async calls...

    Read the article

  • How to use ajax with prototype and jsps

    - by kevinb92
    I'm developing social faq solution. When I click on vote up or vote down, i want to make an ajax call to a java function. I've worked with struts on another project, and i was making call to struts action. Now I work only with simple jsp, servlets ... and I dont know how to make an ajax call to a java function which will send me json or xml.

    Read the article

  • webprogramming -what is the learning pathway ?

    - by Bunny Rabbit
    i have some knowledge of css,jQuery,Grails,django,servlets and jsp still i can't see me designing good professional looking websites .what am lacking ? should i start learning jQUery ui ,should i get into adobe products like flash i am pretty confused. i am pretty bad in the userinterface part,

    Read the article

  • Static method,new thread performance question

    - by ylazez
    Hey guys i just have two questions about two methods used in many controllers/servlets in my app: 1-what is the difference between calling a static method in a util class or a non static method (like methods dealing with dates i.e getting current time,converting between timezones), which is better ? 2-what is the difference between calling a method(contain too many logic like sending emails) in the controller directly or running this method in a different thread ?

    Read the article

  • I want Domain Login in my web application

    - by reply2viveksshah
    i am developing web based HRIs application which is to be deployed on intranet and for dat m using Frontend : jsp/servlets Backend : Oracle Application Server : Tomcat in my web application i want domain login which means by tracing currently logged in user he should automatically logged in my web application pl give me the possible solution Thanks in Advance

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28  | Next Page >