[JBoss JIRA] (FORGE-2164) Being able to create listeners defined in the Servlet spec
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2164?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2164:
-------------------------------------
Description:
It should be possible to create classes implementing ServletContextListener or any other listener defined in the Servlet spec.
A Servlet Listener can implement several interfaces :
{code}
javax.servlet.ServletContextListener
javax.servlet.ServletContextAttributeListener
javax.servlet.ServletRequestListener
javax.servlet.ServletRequestAttributeListener
javax.servlet.http.HttpSessionListener
javax.servlet.http.HttpSessionActivationListener
javax.servlet.http.HttpSessionAttributeListener
{code}
So the command should look like :
{code}
servlet-new-listener --named MyListener --listener ServletContextListener ServletRequestListener HttpSessionListener
{code}
This should generate
{code}
@WebListener
public class MyListener implements ServletContextListener, ServletRequestListener, HttpSessionListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
@Override
public void sessionCreated(HttpSessionEvent se) {
}
@Override
public void sessionDestroyed(HttpSessionEvent se) {
}
@Override
public void requestDestroyed(ServletRequestEvent sre) {
}
@Override
public void requestInitialized(ServletRequestEvent sre) {
}
}
{code}
This should be easier to do with [ROASTER-51]
was:It should be possible to create classes implementing ServletContextListener or any other listener defined in the Servlet spec
> Being able to create listeners defined in the Servlet spec
> ----------------------------------------------------------
>
> Key: FORGE-2164
> URL: https://issues.jboss.org/browse/FORGE-2164
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.12.3.Final
> Reporter: George Gastaldi
> Labels: starter
> Fix For: 2.x Future
>
>
> It should be possible to create classes implementing ServletContextListener or any other listener defined in the Servlet spec.
> A Servlet Listener can implement several interfaces :
> {code}
> javax.servlet.ServletContextListener
> javax.servlet.ServletContextAttributeListener
> javax.servlet.ServletRequestListener
> javax.servlet.ServletRequestAttributeListener
> javax.servlet.http.HttpSessionListener
> javax.servlet.http.HttpSessionActivationListener
> javax.servlet.http.HttpSessionAttributeListener
> {code}
> So the command should look like :
> {code}
> servlet-new-listener --named MyListener --listener ServletContextListener ServletRequestListener HttpSessionListener
> {code}
> This should generate
> {code}
> @WebListener
> public class MyListener implements ServletContextListener, ServletRequestListener, HttpSessionListener {
> @Override
> public void contextInitialized(ServletContextEvent sce) {
> }
> @Override
> public void contextDestroyed(ServletContextEvent sce) {
> }
> @Override
> public void sessionCreated(HttpSessionEvent se) {
>
> }
> @Override
> public void sessionDestroyed(HttpSessionEvent se) {
> }
> @Override
> public void requestDestroyed(ServletRequestEvent sre) {
> }
> @Override
> public void requestInitialized(ServletRequestEvent sre) {
> }
> }
> {code}
> This should be easier to do with [ROASTER-51]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2323?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2323.
----------------------------------
Fix Version/s: 2.16.1.Final
(was: 2.x Future)
Resolution: Done
Thank You!
> Being able to create a new servlet
> ----------------------------------
>
> Key: FORGE-2323
> URL: https://issues.jboss.org/browse/FORGE-2323
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.16.1.Final
>
>
> It would be good to have a command to create a Servlet. A command like this :
> {code}
> servlet-new-servlet --named MyServlet
> {code}
> Would generate
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> Changing the urlPattern would be :
> {code}
> servlet-new-servlet --named MyServlet --urlPatterns myPattern1 myPattern2
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = { "myPattern1", "myPattern2" })
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> The command also allows to generate several methods (get, post, put, delete) :
> {code}
> servlet-new-servlet --named MyServlet --methods GET POST DELETE
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> @Override
> protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doGet invoked");
> }
> @Override
> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doPost invoked");
> }
> @Override
> protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doDelete invoked");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2323?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2323:
-------------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/forge/core/pull/562
> Being able to create a new servlet
> ----------------------------------
>
> Key: FORGE-2323
> URL: https://issues.jboss.org/browse/FORGE-2323
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to create a Servlet. A command like this :
> {code}
> servlet-new-servlet --named MyServlet
> {code}
> Would generate
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> Changing the urlPattern would be :
> {code}
> servlet-new-servlet --named MyServlet --urlPatterns myPattern1 myPattern2
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = { "myPattern1", "myPattern2" })
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> The command also allows to generate several methods (get, post, put, delete) :
> {code}
> servlet-new-servlet --named MyServlet --methods GET POST DELETE
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> @Override
> protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doGet invoked");
> }
> @Override
> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doPost invoked");
> }
> @Override
> protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doDelete invoked");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2323?page=com.atlassian.jira.plugin... ]
Antonio Goncalves reassigned FORGE-2323:
----------------------------------------
Assignee: Antonio Goncalves
> Being able to create a new servlet
> ----------------------------------
>
> Key: FORGE-2323
> URL: https://issues.jboss.org/browse/FORGE-2323
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to create a Servlet. A command like this :
> {code}
> servlet-new-servlet --named MyServlet
> {code}
> Would generate
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> Changing the urlPattern would be :
> {code}
> servlet-new-servlet --named MyServlet --urlPatterns myPattern1 myPattern2
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = { "myPattern1", "myPattern2" })
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> The command also allows to generate several methods (get, post, put, delete) :
> {code}
> servlet-new-servlet --named MyServlet --methods GET POST DELETE
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> @Override
> protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doGet invoked");
> }
> @Override
> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doPost invoked");
> }
> @Override
> protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doDelete invoked");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2323?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2323:
-------------------------------------
Description:
It would be good to have a command to create a Servlet. A command like this :
{code}
servlet-new-servlet --named MyServlet
{code}
Would generate
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
}
{code}
Changing the urlPattern would be :
{code}
servlet-new-servlet --named MyServlet --urlPatterns myPattern1 myPattern2
{code}
This would generate :
{code}
@WebServlet(urlPatterns = { "myPattern1", "myPattern2" })
public class MyServlet extends HttpServlet
{
}
{code}
The command also allows to generate several methods (get, post, put, delete) :
{code}
servlet-new-servlet --named MyServlet --methods GET POST DELETE
{code}
This would generate :
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doGet invoked");
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doPost invoked");
}
@Override
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doDelete invoked");
}
}
{code}
was:
It would be good to have a command to create a Servlet. A command like this :
{code}
servlet-new-servlet --named MyServlet
{code}
Would generate
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
}
{code}
Changing the urlPattern would be :
{code}
servlet-new-servlet --named MyServlet --urlPattern myPattern
{code}
This would generate :
{code}
@WebServlet(urlPatterns = "myPattern")
public class MyServlet extends HttpServlet
{
}
{code}
The command also allows to generate several methods (get, post, put, delete) :
{code}
servlet-new-servlet --named MyServlet --methods GET POST DELETE
{code}
This would generate :
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doGet invoked");
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doPost invoked");
}
@Override
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doDelete invoked");
}
}
{code}
> Being able to create a new servlet
> ----------------------------------
>
> Key: FORGE-2323
> URL: https://issues.jboss.org/browse/FORGE-2323
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to create a Servlet. A command like this :
> {code}
> servlet-new-servlet --named MyServlet
> {code}
> Would generate
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> Changing the urlPattern would be :
> {code}
> servlet-new-servlet --named MyServlet --urlPatterns myPattern1 myPattern2
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = { "myPattern1", "myPattern2" })
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> The command also allows to generate several methods (get, post, put, delete) :
> {code}
> servlet-new-servlet --named MyServlet --methods GET POST DELETE
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> @Override
> protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doGet invoked");
> }
> @Override
> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doPost invoked");
> }
> @Override
> protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doDelete invoked");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2226) Being able to add a CDI injection point
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2226?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2226.
----------------------------------
Fix Version/s: 2.16.1.Final
(was: 2.x Future)
Resolution: Done
> Being able to add a CDI injection point
> ---------------------------------------
>
> Key: FORGE-2226
> URL: https://issues.jboss.org/browse/FORGE-2226
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.14.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.16.1.Final
>
>
> It would be useful to have a command to add a new CDI injection point to an existing bean. A command such as :
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject
> private Logger logger;
> {code}
> A qualifier could be added with:
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --qualifiers Debug Trace
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject @Debug @Trace
> private Logger logger;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2321) Refactor common code into the xxxOperations classes
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2321?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2321.
----------------------------------
Fix Version/s: 2.16.1.Final
(was: 2.x Future)
Resolution: Done
> Refactor common code into the xxxOperations classes
> ---------------------------------------------------
>
> Key: FORGE-2321
> URL: https://issues.jboss.org/browse/FORGE-2321
> Project: Forge
> Issue Type: Enhancement
> Components: UI - API
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.16.1.Final
>
>
> At the moment the class {{JPANewFieldWizard}} defines code as follow :
> {code}
> private List<JavaResource> getProjectEntities(Project project)
> {
> final List<JavaResource> entities = new ArrayList<>();
> if (project != null)
> {
> project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
> {
> @Override
> public void visit(VisitContext context, JavaResource resource)
> {
> try
> {
> JavaSource<?> javaSource = resource.getJavaType();
> if (javaSource.hasAnnotation(Entity.class) || javaSource.hasAnnotation(Embeddable.class)
> || javaSource.hasAnnotation(MappedSuperclass.class))
> {
> entities.add(resource);
> }
> }
> catch (ResourceException | FileNotFoundException e)
> {
> // ignore
> }
> }
> });
> }
> return entities;
> }
> {code}
> This code should go into the {{PersistenceOperations}} class. There are other places like that.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month