Search Results

Search found 1589 results on 64 pages for 'servlet'.

Page 50/64 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • building a web application in eclipse

    - by Noona
    As a concluding assignment for the technologies taught in a data management course, we have to write a web application using the technologies taught throughout the course, this mostly includes xhtml, css, JSP, servelets, JDBC, AJAX, webservices. the project will eventually be deployed using tomcat. we are given the option of choosing the technologies that we see fit. since this is my first time developing a web application I am having some uncertainties about where to start, so for example now I am writing the object classes that will be used in the database and implementing the operations that will be performed on the database, but I am not sure about how to make these operations available to a client through the website, I mean I think I have to write a servlet through which I can extract the request parameters and set the response accordingly, but I would still like a more specific overview of what I am going to do, so if someone can link me to a tutorial with an example that makes use of these technologies while illustrating the stages of the design so that I can see how all these things are linked together in a web project. thanks

    Read the article

  • null pointer exception at org.hibernate.tuple.AbstractEntityTuplizer.createProxy

    - by saurabh
    I am using hibernate 3.2 with struts 1.2 framework I got this exception when i m trying to load the object I am using this code to load the object public Currentprofile findById(java.lang.String id) { log.debug("getting Currentprofile instance with id: " + id); try { Currentprofile instance = (Currentprofile) getSession().get( "com.hibermappings.Currentprofile", id); return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } my hbm file is this <one-to-one name="referenceDb" lazy="proxy" class="com.hibermappings.ReferenceDb" cascade="all" constrained="false" /> <one-to-one name="registration" lazy="proxy" class="com.hibermappings.Registration" cascade="all" constrained="false" /> <one-to-one name="jobseekerpackagedetails" lazy="proxy" class="com.hibermappings.Jobseekerpackagedetails" cascade="all" constrained="false" /> <property name="keyWords" type="java.lang.String"> <column name="keyWords" length="5000" /> </property> <property name="totalExp" type="java.lang.String"> <column name="totalExp" length="100" /> </property> <property name="hqualification" type="java.lang.String"> <column name="hQualification" length="100" /> </property> <property name="preferedLocation" type="java.lang.String"> <column name="preferedLocation" length="100" /> </property> <property name="functionalArea" type="java.lang.String"> <column name="functionalArea" length="1000" /> </property> <property name="expSalary" type="java.lang.String"> <column name="expSalary" length="100" /> </property> <property name="designation" type="java.lang.String"> <column name="designation" length="100" /> </property> <property name="resumeTitle" type="java.lang.String"> <column name="resumeTitle" length="500" /> </property> <property name="profileDetails" type="java.lang.String"> <column name="profileDetails" length="65535" /> </property> <property name="requiredProfile" type="java.lang.String"> <column name="requiredProfile" length="65535" /> </property> <property name="activatedOn" type="java.util.Date"> <column name="activatedOn" length="0" /> </property> <set name="resumes" inverse="true" cascade="save-update"> <key> <column name="jobseekerId" length="50" /> </key> <one-to-many class="com.hibermappings.Resume" /> </set> </class> the same code runs well when I m using in a simple java class within main method .. full stack trace of exception is java.lang.NullPointerException at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372) at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:781) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:774) at com.DAOs.CurrentprofileDAO.getLoad(CurrentprofileDAO.java:71) at com.action.JobSekeerManage.viewProfile(JobSekeerManage.java:447) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at com.filter.HibernateFilter.doFilter(HibernateFilter.java:24) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Error::null

    Read the article

  • Logic for controll concurrent in block/method

    - by Hlex
    1)My environment is web application, I develop servlet to receive request. A) In some block/method i want to control concurrent to not greater than 5 B) if there are 5 request in that block , the new coming must wait up to 60 second then throws error C) if there are sleep/waiting request more then 30, the 31th request will be throwed an error How I do this? 2)(Optional Question) from above I have to distribute control logic to all clustered host. I plan to use hazelcast to share the control logic (e.g. current counter) I see they provide BlockingQueue & ExectorService but I have no idea how to use in my case. Please recommend if you have idea.

    Read the article

  • Tomcat: recommandations for logging

    - by WizardOfOdds
    I've read several questions here concerning Tomcat and logging but I still really don't understand the "bigger picture", hence my question: How and where are my Webapps supposed to do their logging? By default on my setup Tomcat 6.0.20 logs go in the following file/appender: ./apache-tomcat-6.0.20/logs/catalina.out Am I suppose to have my webapps also log to this file/appender? Let say my case is trivially simple and I've got just one servlet: import ... // What do I import here in order to be able to log? public class SOServlet extends HttpServlet { public void doGet( final HttpServletRequest request, final HttpServletResponse response ) throws IOException, ServletException { ... // I want to log here, what do I write? What are the gotchas knowing that there are more than one webapp running on the same Tomcat? (apparently from reading the various questions there are many gotchas). What about the .war, do I need to put log4j/sl4f/commons-logging/whatever in my .war?

    Read the article

  • how to config grails1.2 with oscache?

    - by wavelet
    I do this : DataSource.groovy: hibernate { cache.use_second_level_cache=true cache.use_query_cache=true cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider' } and in BuildConfig.groovy: inherits( "global" ) { // uncomment to disable ehcache excludes 'ehcache' } runtime ("opensymphony:oscache:2.4.1") { excludes 'jms', 'commons-logging', 'servlet-api' } but i only get this error : commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeAdapter] was not found when attempting to load Grails application. Skipping. commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeService] was not found when attempting to load Grails application. Skipping. hibernate.ConfigurableLocalSessionFactoryBean There was an error configuring the Hibernate second level cache: could not instantiate CacheProvider [com.opensymphony.oscache.hibernate.OSCacheProvide] hibernate.ConfigurableLocalSessionFactoryBean This is normally due to one of two reasons. Either you have incorrectly specified the cache provider class name in [DataSource.groovy] or you do not have the cache provider on your classpath (eg. runtime ("net.sf.ehcache:ehcache:1.6.1")) how can i do it?

    Read the article

  • FOP Encoding issue

    - by Ravi chandra
    Hi Guys, I have a similar issue.. I have HTML stored in DB clob. I am retrieving that and converting to XHTML using TIDY.jar. Once i got XHTML then using FOP i am converting to XSL-FO. Finally XSL-FO is rendering in PDF. Previously everything is working fine with Linux-WAS5-java1.4. Recently we migrated the apps to Linux-WAS6-Java1.5. Now XHTML to XSL-FO is messing up everything. XSL-FO contains ???(Question marks) in the place of Euro, spase(nbsp), Agrave, egrave ..etc. I tried changing the JVM encoding to UTF-8 and also i have modified my servlet request and response to support UTF-8. I am helfless and unable to figure where exactly the issue is coming out. Can someone please check this and suggest me some solution. Thanks in advance

    Read the article

  • Struts/JSP/J2EE performance and memory profiling and issues

    - by Berlin Brown
    We are using Struts and having performance issues. And making heavy use of jsp includes, tiles, EL expressions. I am sure this is eating up a lot of memory and processing time. What are some approaches to profile the JSP page? What tools could I use? What should I look for when profiling? I have seen the code generated JSP Java Servlet Code and I see the bottlenecks but would rather measure it more accurately. This is under JDK1.5 and IBM Websphere 6.1 (RAD7)

    Read the article

  • php curl post parameters not passed to server

    - by user121196
    <?php $data = array('name' => 'Ross', 'php_master' => true); $url="http://localhost/test.php"; $handle = curl_init($url); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); curl_exec($handle); ?> the $_POST variable on server side is empty, I also tried using java servlet, request.getParameterNames() is also empty. why are the post parameters lost?

    Read the article

  • Websphere exception handling

    - by Benjamin
    Hi all, From a security standpoint, what is the best solution to handle application errors with Websphere? I've been thinking of creating a class that is called every time an application error is generated, log the error and display a generic error message to the users. In PHP this can be achieved using the set_exception_handler() function. Is there something similar for websphere that could be configured in the web.xml? I've found codes like this on the internet: <error-page> <error-code>500</error-code> <location>/servlet/ExceptionHandlerServlet</location> </error-page> But that would only work with "500" HTTP error codes. I really want something generic that catches everything. Something like a class that implements a certain interface which can have access to all information about the error. Thanks for your time.

    Read the article

  • DataSource or ConnectionPoolDataSource for Application Server JDBC resources

    - by Vinnie
    When creating JNDI JDBC connection pools in an application server, I always specified the type as javax.sql.ConnectionPoolDataSource. I never really gave it too much thought as it always seemed natural to prefer pooled connections over non-pooled. However, in looking at some examples (specifically for Tomcat) I noticed that they specify javax.sql.DataSource. Further, it seems there are settings for maxIdle and maxWait giving the impression that these connections are pooled as well. Glassfish also allows these parameters regardless of the type of data source selected. Are javax.sql.DataSource pooled in an application server (or servlet container)? What (if any) advantages are there for choosing javax.sql.ConnectionPoolDataSource over javax.sql.DataSource (or vice versa)?

    Read the article

  • How to solve JavaScript origin problem with an application and static file server

    - by recipriversexclusion
    In a system that I'm building I want to serve Static files (static HTML pages and a lot of images), and Dynamic XML generated by my servlet. The dynamic XML is generated from my database (through Hibernate) and I use Restlets to serve it in response to API calls. I want to create a static file server (e.g. Apache) so that this does not interfere with the dynamic server traffic. Currently both servers need to run on the same machine. I've never done something like this before and this is where I'm stuck: The static HTML pages contain JavaScript that makes API calls to the dynamic server. However, since the two servers operate on different ports, I get stuck with the same origin problem. How can this be solved? As a bonus, if you can point me to any resources that explain how to create such a static/dynamic content serving system, I'll be happy. Thanks!

    Read the article

  • Jython java call throws exception asking for 2 args when only one arg is coded

    - by clutch
    I have an Java method I want to call within my Jython servlet running on tomcat5. It looks like this: @SuppressWarnings("unchecked") public School loadByName(String name) { List<School> school; school = getHibernateTemplate().find("from " + getPersistentClass().getName() + " where name = ?", name); return uniqueResult(school); } I call it in Jython using: foobar = SchoolDAOHibernate.loadByName('Univeristy') It throws an error that says loadByName() expects 2 args; got 1. What other argument could it be looking for?

    Read the article

  • Java: InitialContext.lookup(String) - what should the value o the parametr be?

    - by bguiz
    To instantiate a Stateful Session Bean inside of a JSP/ servlet, I am using: InitialContext ic = new InitialContext(); SomeStateful state = (SomeStateful) ic.lookup("java:comp/env/SomeStatefulBean"); Trial and error had me prefix the name of my EJB with java:comp/env/, so the above works (on Glassfish 2.1). However I want to know what the proper way to obtain this prefix is. Is there a CLI tool or function somewhere in the admin panel that will allow we to examine/ alter this? Is this platform/ application server dependant? Is there a setting within my ear, EJB-jar or war which I can examine or alter for this? (Forgive the beginner question) Thanks!

    Read the article

  • App-Engine (Java) File Upload

    - by Manjoor
    I managged to upload files on app-engine by using the following example http://stackoverflow.com/questions/1513603/how-to-upload-and-store-an-image-with-google-app-engine-java and http://www.mail-archive.com/[email protected]/msg08090.html The problem is, I am sumitting other fields along with file field as listed below <form action="index.jsp" method="post" enctype="multipart/form-data"> <input name="name" type="text" value=""> <br/> <input name="imageField" type="file" size="30"> <br/> <input name="Submit" type="submit" value="Sumbit"> </form> In my servlet I am getting null when querying name = request.getParameter("name"); Why it is so? Is there a way to retrieve text field value?

    Read the article

  • which techonology is good for my online store?

    - by 5YrsLaterDBA
    I am thinking about build a online store for my wife to sale something. we need database for customer info and goods info. we also need shopping cart for customers to use. I have yrs java experience but no web experience (know a little about jsp and servlet). I am thinking using wicket and other java technologies plus MySQL to build it. but I am open to other options. I am willing to learn new things. what's your expert views? thanks,

    Read the article

  • Sending BLOBs in a JSON service,... how?

    - by Marten Sytema
    Hello I have a webservice (ie. servlet) implemented in Java. It gets some data from a MySQL table, with one column being of type BLOB (an image), and some other columns are just plain text. Normally I would store the file outside the database with a pointer to it in the database, but due to circumstance I now have to use this BLOB column... What is the proper way to send this? How to encode the image in a JSONObject, and how to parse (and RENDER!) it on the otherside ? I want to use JSONP, to avoid having to proxy it through the consumer's webserver. So that the consumer can just put in a tag pointing to the webservice, calling a callback. Any thoughts how to handle images in this situation? Also thoughts on performance etc. are interesting!

    Read the article

  • Grails Runtime Exception with Audit Logging Plugin

    - by Paul
    I've deployed my app to tomcat running on EC2 via Cloud Foundry. The application uses the Grails Audit Logging Plugin I'm getting the following runtime error: Error 500: Executing action [save] of controller [com.questern.aoms.CompanyController] caused exception: groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Servlet: grails URI: /aoms/grails/company/save.dispatch Exception Message: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Caused by: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Class: CompanyController At Line: [30] The exception is: groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent at $Proxy10.saveOrUpdate(Unknown Source) at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy:30) at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy) I have added the import statement to the controller CompanyController, but to no avail. import org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent I checked the war file and the AuditLogEvent is include in: aoms-0.1.war\WEB-INF\classes\org\codehaus\groovy\grails\plugins\orm\auditable\ Any suggestions as to what the problem could be?

    Read the article

  • Can FileOutputStream() take a relative path as an argument

    - by Ankur
    I am creating a FileOutputStream object. It takes a file or String as an argument in its constructor. My question is, can I give it a relative URL as an argument for the location of a file, it doesn't seem to work, but I am trying to work out if this is possible at all (if not I will stop trying). If it is not possible, how can I (from a servlet) get the absolute path (on the filesystem, not the logical URL) to the current location in such a way that I can pass that to the constructor. Part of my problem is that my dev box is Windows but I will publish this to a Unix box, so the paths cannot be the same i.e. on Windows C:/.... and on unix /usr/...

    Read the article

  • html post issue

    - by Amarsh
    i have the following html code : <FORM name=frmmail> <input id="dochtmlContent" type="hidden" name="dochtmlContent" value="oldValue"/> <script>document.dochtmlContent="newValue"</script> </FORM> and later on in a javascrip function (which is called upn submit): alert(document.dochtmlContent); document.frmmail.method = "post"; document.frmmail.ENCTYPE = "application/x-www-form-urlencoded"; document.frmmail.action = "/myServlet"; document.frmmail.submit(); Basically, I am declaring a hiden variable, changing its value and submitting it. The issue is, while I see an alert box displaying "newValue", when I submit it, my servlet recieves the "oldValue" for the dochtmlContent parameter. Can someone suggest whats wrong here.

    Read the article

  • What should I learn to improve my Java skills ?

    - by hory.incpp
    Hello, I currently know Java SE and I want to learn something more 'enterprise'. I would like something more distributed (app server, server programming, web, content management system ...) but any suggestion is ok. There are many frameworks which I've heard: spring, hibernate, persistence, ejb, jsp, servlet, jsf, jboss, glassfish, ant etc etc etc etc. I'm very confused where to start. So the question is: Can somebody explain to me what actually there frameworks are; and which one should I start with ? Thank you.

    Read the article

  • Reverse massive text file in Java

    - by DanJanson
    What would be the best approach to reverse a large text file that is uploaded asynchronously to a servlet that reverses this file in a scalable and efficient way? text file can be massive (gigabytes long) can assume mulitple server/clustered environment to do this in a distributed manner. open source libraries are encouraged to consider I was thinking of using Java NIO to treat file as an array on disk (so that I don't have to treat the file as a string buffer in memory). Also, I am thinking of using MapReduce to break up the file and process it in separate machines. Any input is appreciated. Thanks. Daniel

    Read the article

  • How to load a configuration file at startup within tomcat

    - by Alex
    I want to be able to load my configuration for the webapp at startup of tomcat (apache commons configuration library) is this a possible way: public class MyAppCfg implements javax.servlet.ServletContextListener { private ServletContext context = null; @Override public void contextInitialized(ServletContextEvent event) { try{ this.context = event.getServletContext(); XMLConfiguration config = new XMLConfiguration("cfg.xml"); config.setReloadingStrategy(new FileChangedReloadingStrategy()); this.context.setAttribute("mycfg", config); } catch (Exception e) { e.printStackTrace(); } } @Override public void contextDestroyed(ServletContextEvent arg0) { this.context = null; } } web.xml <listener> <listener-class>mypackage.MyAppCfg</listener-class> </listener> and later acces them in the webapp via this.cfg = (XMLConfiguration) servletRequest.getAttribute("mycfg");

    Read the article

  • java methods and race condition in a jsp/servlets application.

    - by A.S al-shammari
    Hi. Suppose that I have a method called doSomething() and I want to use this method in a multithreaded application (each servlet inherits from HttpServlet).I'm wondering if it is possible that a race condition will occur in the following cases: doSomething() is not staic method and it writes values to a database. doSomething() is static method but it does not write values to a database. what I have noticed that many methods in my application may lead to a race condition or dirty read/write. for example , I have a Poll System , and for each voting operation, a certain method will change a single cell value for that poll as the following: [poll_id | poll_data ] [1 | {choice_1 : 10, choice_2 : 20}] will the JSP/Servlets app solve these issues by itself, or I have to solve all that by myself? Thanks..

    Read the article

  • Best Tomcat6 JNDI + Hibernate configuration for session/transaction support

    - by EugeneP
    I use tomcat6 as a servlet container, and need to integrate Hibernate 3.2 into the project. I found a document how to configure SessionFactory lookup through JNDI, though it does not work as expected. Quote: Hibernate works in any environment that uses JTA, in fact, we recommend to use JTA whenever possible as it is the standard Java transaction interface. End of quote. In hibernate config I indicate current_session_context_class = jta and now I get an error "No TransactionManagerLookup specified". The problem is that Tomcat does not support JTA, and to get it worked, if I understand it correctly, you need to add JOTM or other library to Tomcat. But according to quote it is recommended to use JTA. What can you recommend in this situation?

    Read the article

  • Can Tomcat provide seperate (or HTTPS only) sessions for HTTPS requests?

    - by Joe
    I have a web application which contains both secure (SSL) and non-secure pages. A user can login to the site and must appear logged-in in both the SSL and non-SSL areas. (NB. SSL isn't implemented via Tomcat, but via Apache HTTPD servers which sit in front of Tomcat - so Tomcat has no SSL configuration.) The logged-in state is currently maintained via a servlet session (using Tomcat's vanilla session management). The obvious issue with this approach is that the JSESSIONID cookie is transported over both HTTP and HTTPS connections, meaning that it's potentially possible to intercept it and hijack the session. Are there any solutions to this without rolling our own session management (i.e. does Tomcat cater for this situation)? I'm prepared to implement our own session management, but don't want to reinvent something that may already be supported.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >