Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4002630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:03:10+00:00 2026-05-20T08:03:10+00:00

i working in a j2ee project (pojo layer, Dao layer(hibernate), Service Layer(spring), View(spring mvc))

  • 0

i working in a j2ee project (pojo layer, Dao layer(hibernate), Service Layer(spring), View(spring mvc))
i have a table of articles after each row i want to add a link to remove it.

this is my view

<c:if test="${!empty articles}">
<table>
    <tr>
        <th>Article ID</th>
        <th>Article Name</th>
        <th>Article Desc</th>
        <th>Added Date</th>
        <th>operation</th>
    </tr>

    <c:forEach items="${articles}" var="article">
        <tr>
            <td><c:out value="${article.articleId}"/></td>
            <td><c:out value="${article.articleName}"/></td>
            <td><c:out value="${article.articleDesc}"/></td>
            <td><c:out value="${article.addedDate}"/></td>
            <td><a href="articles/${article.articleId}">delete</a></td>
        </tr>
    </c:forEach>
</table>

here is the controller to delete

@RequestMapping(value="/articles/{articleId}", method=RequestMethod.POST)
public String deleteContact(@PathVariable("articleId")
Integer articleId) {

    articleService.removeArticle(articleId);

    return "redirect:/articles.html";
}

this is the servcice layer

    @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void removeArticle(Integer id) {
    articleDao.removeArticle(id);
}

this is the Dao layer (i try to find the article then to remove it)

    public void removeArticle(Integer id) {
            //to get the article
    Article article = (Article) sessionFactory.getCurrentSession().load(
            Article.class, id);
    if (null != article) {
        sessionFactory.getCurrentSession().delete(article);
    }

}

but when i run the project and i click the delete link, i have an 404 error
Etat HTTP 404 – /Spring3Hibernate/articles/1
description The requested resource (/ Spring3Hibernate/articles/1) is not available

can somebody help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:03:11+00:00Added an answer on May 20, 2026 at 8:03 am
     <td><a href="articles/${article.articleId}">delete</a></td>
    

    This is standard GET request, but your controller is mapped to POST.

    @RequestMapping(value="/articles/{articleId}", method=RequestMethod.POST)
    

    In addition, it looks like very big security issue. I can write very simple 10 lines program which will call using get or post request to from /articles/1 to /articles/{any number} and delete your entire data. I recommend just to take it into consideration while designing such applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the future I will be working with MVC with java/j2ee,hibernate,and more, but for
I am working on an application in J2EE, Spring mvc. Application has two themes.
I'm working on particular application, a spring+hibernate setup. I have one front end in
I have been working in Java/J2ee projects, in which I follow the Maven structure.
we have a J2EE app on which we're still working. It runs on Oracle
Working on a project at the moment and we have to implement soft deletion
I'm working in J2EE web project, which has lots of Java, SQL scripts, JS,
Background about myself: I have about 3 years experience working in Java/J2EE. I am
I am working on a j2ee project, which is a public website. The application
I am working on a projec, the application is in j2ee and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.