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 8048109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:19:32+00:00 2026-06-05T06:19:32+00:00

I’m having big trouble with Magnolia Servlet, so far I’ve tried everything I can

  • 0

I’m having big trouble with Magnolia Servlet, so far I’ve tried everything I can think of.

Regarding to the magnolia documentation we can set servlet definition in module definition instead of web.xml (which sounds more neat idea especially for expanding)

So I placed this code in my xml module

 <servlets>
    <servlet>
        <name>jcaptcha</name>
        <class>com.octo.captcha.module.servlet.image.SimpleImageCaptchaServlet</class>
        <mappings>
        <mapping>/jcaptcha.jpg</mapping>
        </mappings>
    </servlet>
 </servlets>

And then I created the bypass node (config.server.filters.bypasses.jcaptcha.xml) for the filter

 <?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="jcaptcha" xmlns:sv="http://www.jcp.org/jcr/sv/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:contentNode</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>f845ae89-a537-4e9f-b074-57d812fd92a6</sv:value>
    </sv:property>
    <sv:property sv:name="class" sv:type="String">
        <sv:value>info.magnolia.voting.voters.URIStartsWithVoter</sv:value>
    </sv:property>
    <sv:property sv:name="pattern" sv:type="String">
        <sv:value>/jcaptcha.jpg</sv:value>
    </sv:property>
    <sv:node sv:name="MetaData">
        <sv:property sv:name="jcr:primaryType" sv:type="Name">
            <sv:value>mgnl:metaData</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:activated" sv:type="Boolean">
            <sv:value>false</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:activatorid" sv:type="String">
            <sv:value>superuser</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:authorid" sv:type="String">
            <sv:value>superuser</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:creationdate" sv:type="Date">
            <sv:value>2007-04-25T18:23:31.784+02:00</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:lastaction" sv:type="Date">
            <sv:value>2007-05-02T17:00:15.025+02:00</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
            <sv:value>2012-06-07T05:41:25.275-05:00</sv:value>
        </sv:property>
    </sv:node>
</sv:node>

Still when I request localhost/magnolia/jcaptcha.jpg it gives me 404 error.
“But” When I put the servlet definition in web.xml , it gives the right result.

Can anyone tell me what am I missing?

  • 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-06-05T06:19:34+00:00Added an answer on June 5, 2026 at 6:19 am

    Here is the answer I got from magnolia forum

     <servlets>
     <servlet>
     <name>jcaptcha</name>
     <class>com.octo.captcha.module.servlet.image.SimpleImageCaptchaServlet</class>
     <mappings>
     <mapping>/jcaptcha.jpg</mapping>
     </mappings>
     </servlet>
     </servlets>
    

    Doing so tells Magnolia to run the servlet for you. You can verify that the servlet is installed when you install module in config:/server/filters/servlets/jcaptcha.

    And then I created the bypass node (config.server.filters.bypasses.jcaptcha.xml) for the filter

    Doing so you tell Magnolia to NOT treat said bypass url, but instead let Servlet container handler that request. Since only Magnolia knows about the servlet, but not the container you get 404. Once you make container aware of the servlet (by adding it to web.xml) you get the result.

    You have 2 options – either you keep bypass and definition in web.xml or you keep the servlet definition in your module. You can’t have both.
    Also please remember that Magnolia will read servlet definition from your module descriptor during installation of the module, so if that module was already installed, you need to invoke info.magnolia.module.delta.RegisterModuleServletsTask as part of your update.

    HTH,
    Jan

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.