I developed an web application using java spring mvc. Now i want to deploy the application on tomcat server and want the application to run in a certain period of time in a day. Say, the application will run from 10:00 AM to 6:00 PM everyday and other time of the day the application cannot be used. I have searched if anything can be done with tomcat server 6 where i want to deploy my application but unable to get any solution or clue how to achieve the purpose. So, my question is how can i implement what i wanted to do? Any solution, samples or ideas will be much helpful to complete the task.
How to fix java spring mvc web application run time in Apache Tomcat 6 server?
280 Views Asked by Junaid AtThere are 2 best solutions below
Mare Geldenhuys
On
I think you are trying to solve your problem using your infrastructure instead of using your application where it should be solved.If the requirement is to not have the application available during a certain period of time, which is a business requirement, code a solution for it. You could for example not allow logins if the login falls outside the specified time period and then instead display a message to a user. Existing sessions could be intercepted using a handler and then invalidating the session forcing a re-login.
Another solution would be to run a cron job on the server, which stops Tomcat at a specified time and starts it back up again. This would not be advisable as your users will not know of the operating times and most probably assume something is wrong.
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in SPRING-MVC
- springboot class org.hibernate.mapping.Bag cannot be cast to class org.hibernate.mapping.SimpleValue
- Spring security causing 404 with message "No static resource login"
- Getting error while deploying war in tomcat 9
- Why Jackson needs a default constructor?
- what is error for the below springmvc code?
- Expected a JavaScript module script but the server responded with a MIME type of "text/html" -- when integrating Angular FrontEnd with spring MVC
- How to manage exceptions thrown in filters(common filters not only spring-security)?
- Bean Validaton : org.springframework.web.bind.MethodArgumentNotValidException
- Where I use @ExtendsWith(MockitoExtension.class) and @SpringBootTest anyone clarify me with example
- maven clean install and mvn spring-boot:run gives me on POST request 401 (Unauthorized) error
- How to deploy Tibco GI to windows 10
- Spring Boot request body validation not working
- maintain the session after logout in existing spring mvc project
- kendo is not defined after upgrade springboot from 2.0 to 3.1
- Cors not allowed to completed the request in Spring MVC
Related Questions in TOMCAT
- Unable to compile the class for JSP in tomcat 8.5.95
- detect catalina.out log path from a running tomcat on non-Windows
- Tomcat 9.0.80 with Open JDK (JRE only) v16.0.2 crashing/unresponsive several times a day with load: Thread Count hits Max and All Threads are Busy
- JAX-RS webapp deployed to Tomcat returns HTTP 404 error while it works fine in Eclipse
- Illegal access: this web application instance has been stopped already. Could not load [org.apache.logging.log4j.message.SimpleMessage]
- File Upload Handling: Inconsistent HTTP Response Codes for Different File Sizes with Exception in Tomcat
- Don't get any public folder when deployment in svelte kit app
- Accessing solr web interface behind reverse proxy returns "Content Encoding Error"
- java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
- Cannot decrypt the password in application.yml properly if war file in the tomcat/webapps
- how to deploy mock json data api's(json-server) and angular 17 application in apache tomcat server 9 version
- version compatibility issue between spring boot, struts2-core and tomcat-embed-jasper in web application
- Is there any possibility to use JTA with Spring Framework 6 and Tomcat or Payara?
- Eclipse issue with publishing to Tomcat server
- null in Camunda variables
Related Questions in WEB-APPLICATIONS
- Error fetching the entry page through Django url path
- How To Convert Nextjs Typescript Golang Postgresql Web App Into Desktop App
- Error connecting to SQL Server in AspNetCore applications
- apache2 rotatelogs creates log file but its empty when deployed to azure web app
- how to do the sort function with specific value when the page load i dont know much about coding
- Getting error System.Management.Automation.PSSecurityException HResult=0x80131501 in web application
- Creating a Desktop Version of a Web Application (NextJS TypeScript Golang Echo)
- create django models using HTML form
- Any HTML standards to limit resource of the HTML content?
- .NET 7 Web Application sending an HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory
- How to get a postMessage message from Duda into the embedded iframe?
- error 'formDataList' isn't defined. in flutter app
- OPEN ID connect request to refresh access token
- C# EF get DbContext outside of WebApplication
- Predicting V8's Math.random() truncated outputs
Related Questions in TIME-MANAGEMENT
- flutter: how to change current date and time from my app
- Get the name of the current opened application in python
- File Time sum not showing org mode Clock Table
- Javascript discontinuous stacked bar graph
- How to fix java spring mvc web application run time in Apache Tomcat 6 server?
- Android Programming execute function at determined time
- In using OpenErp 7 or Odoo 8, how do I modify it such that a manager assigned to a project is the one who will approve all timesheet entries for it?
- Count / sum-up weekly work time by calendar category (MS Outlook)
- Telling Bullet That Something Happened In The Past
- how can i restrict access to certain programs in windows?
- Dynamic ordering of task list by time
- How do I go about implementing time management for auction website?
- Org-mode: divide agenda by blocks of 20 items
- Always staying behind at work - sign of bad project management?
- Calculating Project Programming Times
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Finally i have implemented the mechanism of running my web application on tomcat server for certain period of time in a day. I used an custom interceptor by extending HandlerInterceptorAdapter of spring framework to intercept all servlet requests. Then in the preHandle function, all servlet requests have been haul and then checked current time if it is within the time period the application will run. If it is within time period, then the requests are allowed to proceed, else redirected to a specific page prompting user they can't access the application currently.