Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1784ff9f
authored
Mar 01, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added /MoyaWeb/currenttime servlet, which returns System.currentTimeMillis() function
1 parent
8a2b16a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
code/MoyaWeb/src/fi/codecrew/moya/servlet/TimeServlet.java
code/MoyaWeb/src/fi/codecrew/moya/servlet/TimeServlet.java
0 → 100644
View file @
1784ff9
package
fi
.
codecrew
.
moya
.
servlet
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
javax.servlet.ServletException
;
import
javax.servlet.annotation.WebServlet
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* Servlet implementation class UploadServlet
*/
@WebServlet
(
urlPatterns
=
{
"/currenttime"
})
public
class
TimeServlet
extends
HttpServlet
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
PrintWriter
w
=
resp
.
getWriter
();
w
.
write
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
w
.
flush
();
w
.
close
();
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment