Apache Sling JCR Resource Resolver to remove selected pattern

Hello,
I have a requirement to remove selected pattern from all urls. Pattern will look like:
<domain>/content/mysite/en/section1.html -> <domain>/section1.html
<domain>/content/mysite/en/section1/cat1.html -> <domain>/section1/cat1.html
<domain>/content/mysite/en/section1/cat1/page.html -> <domain>/section1/cat1/page.html
I am new to mappings so looking for help from expert.
Thanks for your help in advance.
Regards,
Mohit

Does your domain represent a language? If there is no relationship between domain and the paths you are removing (for example www.mysite.com maps to /content/mysite/en and www.mysite.fr maps to /content/mysite/fr) then you can just use the resource resolver and not have to use /etc/maps approach. You would add /content/mysite/en/-/ to the resource.resolver.mapping property of the JCR Resource Resolver (make sure that the last property is /-/. You can do that either in the OSGI Felix console or via OSGI repository configuration.
If you are using Dispatcher for caching you need to consider using Apache mod_rewrite for handling the incoming mappings. If you rely solely on the JCR Resource Resolver (or and /etc/maps approach) you can cause problems with cache flushing. If you don't use Apache mod_rewrite to change /section1.html to /content/mysite/en/section1.html then the request gets cache in the docroot as /section1.html. When you publish a change to /content/mysite/en/section1.html Dispatcher will not make the propery association and will touch the wrong stat file. Now if your stat file level is set to 0 and you set up to auto-invalidate HTML you will probably not notice the impacts immediately. If however you set your stat file level above zero, or you have non-standard auto-invalidation settings you may have problems with your cache flushing. In general anytime I do I am using Dispatcher I use Apache mod_rewrite to handle incoming rewrites. I still configure the JCR Resource Resolver to handle both incoming and outgoing rewrites so that I can test the site directly against the publish server if I need to, but I'll set up mod_rewrite to handle incoming rewrites and avoid any cache flush issues.
For SEO purposes in scenarios you will want to configure Apache mod_rewrite to prevent requests directly to the full path. Often times you will either have an outgoing link not get rewritten to the short URL, or someone will send out the full link by accident so you will want to prevent those links from working - potential by doing a 301 redirect of /content/mysite/en/section1.html back to /section1.html. This prevents SEO issues, but you do have to make sure you don't create an infinte loop since the redirected request will then get rewritten to the long URL.

Similar Messages

  • Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through j

    Certainly I realized that Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through jquery or javascript.
    e.g.
    In Felix Console , in Apache Sling JCR Resource Resolver configuration I have added following mapping.
    /content/myproject/-/
    So If any anchor tag is there like <a href="/content/myproject/en.html"> click me </a> then it will be mapped to "/en.html" automatically.
    But the problem is there in following scenario.
    I have an anchor tag as follows.
    <a href="#" id="test"> click here </a>
    And I am assigning the href to anchor through JQUERY.
    <script>
    $("#test").attr("href","/content/myproject/en.html");
    </script>
    Ideally this should have been mapped to "/en.html".
    But it is not mapping to "/en.html". It still shows "/content/myproject/en.html".
    How to resolve this.
    Thanks,
    Sai

    In a servlet you have access to the resourceResolver so if you know which attributes contain links then it's relatively easy to apply resourceResolver.map to those links.
    Your challenge is clearly how do you know which attributes are links and which aren't. Its is the same challenge that makes parsing the response and rewriting it on the way out difficult - the JSON doesn't have any semantic meaning so how do identify which attributes require rewriting. There really is no good answer ot that question in my experience - all the options have down sides.
    Create some convention - all attributes matching this pattern X get mapped before being converted to JSON (could be attributes whose name ends in link, or it could a convention applied to the value of the attribute - if the attribute is a string that starts with /content apply the resource resolver mapping. In this case you have train your developers to follow this convention which is the down side.
    Create some configurable list of attribute names that require mapping. This is brittle, requires training and is easy to break.
    Implement a client side version of the resource resolver mapping. It wouldn't be as full proof as server side mapping (because that takes into account but you could make it work for simple logic like stripping of /content/site/en. If ou are just trying to solve the simple version of this issue - stripping off the top of the repository path this might be your best option.
    Not worry about it and set up Apache 301 redirects that catch any long URLs and redirect them to short URLs (so configure apache to look for any URL matching /content/site/en and strip off /content/site/en and do a 301 redirect to the shortened URL. You end up with a lot of extra HTTP request because of all the 301s but it would work (I wouldn't recommend this option - but it is possible).

  • Apache Sling Logging Writer Configuration

    Hi,
    I'm having an issue where my custom log writer configuration is not being picked up and used by CQ5 sometimes.  I've created a custom error log writer based on the example provided at http://helpx.adobe.com/cq/kb/HowToRotateRequestAndAccessLog.html which I've installed on an author, replicated it to the publishers, and all seemed ok and working correctly.  The settings are:
    Log File: ../logs/error.log
    Number of Log Files: 5
    Log File Threshold: 200MB
    After installing this, the error logs rotated at 200MB resulting in error.log.0, error.log.1 etc as expected.
    However after rebuilds on the machines, this configuration was overwritten (as expected).  So I've installed and replicated the package again, but now the configuration is not taking effect.  I'm using the exact same config package as I was previously, but the logs don't seem to be rotating at all now (not even daily).  I've deleted the config from the Felix console on all authors and publishers, reinstalled on the authors, replicated to the publishers, then restarted the CQ5 service on all machines, but it's still not working.
    So I have a couple of questions about this:
    Is there somewhere else in CQ5 that might be overriding these log writer config settings?
    Is ../logs/error.log correct for the standard log file location?  A note in step 3 of Creating Your Own Loggers and Writers on http://dev.day.com/docs/en/cq/current/deploying/configure_logging.html states:
    Log writer paths are relative to the crx-quickstart/launchpad location.
    Therefore, a log file specified as logs/thelog.log writes to crx-quickstart/launchpad/logs/thelog.log.
    To write to the folder crx-quickstart/logs the path must be prefixed with ../ (as../logs/thelog.log).
    So a log file specified as ../logs/thelog.log writes to crx-quickstart/logs/thelog.log.
         The configs in the log rotation example also use ../logs.  However when looking at the default/standard logging writer config, it uses logs/error.log.  Which one is correct?
    Any help on what's going on here would be appreciated!!
    Thanks,
    K

    Hi,
    I am answering your last question and this one here only.
    1. Log configuration can be override at project via creating config and overriding factory "org.apache.sling.commons.log.LogManager.factory.config-<identifier>" and writer (if required) "org.apache.sling.commons.log.LogManager.factory.writer-<identifier>". So plz check if you have configure log at project level. Now if you are not able to see then plz recheck you log configuration in felix console http://localhost:4502/system/console/slinglog here you can see entire log configuration for CQ system.
    2. both will work but the location will change
         i. CQ 5.5 - log file located under "crx-quickstart" ../logs/<filename>.log will create under this
         ii. CQ 5.4 - logs creates under "crx-quickstart\logs" also under "crx-quickstart\launchpad\logs" so if you select ../logs/ it will go under "crx-quickstart\logs" only but you can change wherever you want to store. Again you can see this configuration info at http://localhost:4502/system/console/slinglog
    3. You can also customize you log via creating at project level and assigning the "identifire" (with all other configure parameters) for more information you can refer http://sling.apache.org/site/logging.html apart from earlier share links.
    I hope above will help you to proceed. Please let me know for more information.
    Thanks,
    Pawan

  • Facing org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

    Hi,
    I am facing below issue in Performance testing does anyone guide why this error is coming. Individually these pages are running fine. Attached logs for your reference.
    Thank ,
    Yogesh
    17.01.2013 05:10:57.232 *ERROR* [135.215.244.155 [1358421056013] GET /content/Intranet/microsite/innovation/right.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException org.apache.sling.api.SlingException:
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInterna l(JspServletWrapper.java:560)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:496)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:448)
            at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :173)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:84)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:388)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 56)
            at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:491)
            at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:45)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)
            at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:146)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:308 )
            at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:141)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProce ssorImpl.java:280)
            at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChai n.java:49)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)
            at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:185)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgre ssTrackerLogFilter.java:59)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.j ava:220)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at com.day.cq.theme.impl.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:67)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:96)
           at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.portal.container.internal.request.PortalFilter.doFilter(PortalFilter.jav a:76)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServle tStarterFilter.java:135)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcess orImpl.java:171)
            at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:199)
            at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:9 6)
            at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
            at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java: 42)
            at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:49)
            at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)
            at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:249)
            at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
            at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
            at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)
            at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)
            at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java: 48)
            at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
            at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:60)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate. java:277)
            at org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:148)
            at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.ja va:228)
            at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:315)
            at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:74)
            at com.day.crx.launchpad.filters.CRXLaunchpadLicenseFilter.doFilter(CRXLaunchpadLicenseFilte r.java:96)
            at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:72)
            at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:334)
            at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:378)
            at com.day.j2ee.servletengine.ServletHandlerImpl.execute(ServletHandlerImpl.java:315)
            at com.day.j2ee.servletengine.DefaultThreadPool$DequeueThread.run(DefaultThreadPool.java:134 )
    Caused by: org.apache.sling.api.SlingException:
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInterna l(JspServletWrapper.java:560)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:496)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:448)
            at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :173)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:84)
            at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:388)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)
            at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 56)
            at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:491)
            at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:45)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)
            at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:182 )
            at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:149)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:219)
            at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
            at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProce ssorImpl.java:280)
            at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProces sorImpl.java:320)
            at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatch er.java:208)
            at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatche r.java:102)
            at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponent Filter.java:381)
            at org.apache.jsp.libs.foundation.components.primary.cq.Page.Page_jsp._jspService(Page_jsp.j ava:106)
            at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:419)
            ... 66 more
    Caused by: java.lang.NullPointerException
            at com.day.cq.wcm.foundation.ELEvaluator.evaluate(ELEvaluator.java:53)
            at org.apache.jsp.libs.foundation.components.page.page_jsp._jspService(page_jsp.java:126)
            at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:419)
            ... 90 more

    Also we are facing one more issue in PT testing and that is related to segment.So not sure what is issue. We have tested all sgement defined by us its working fine individually. But same fails in PT.
    Thanks,
    Yogesh
    This is log we get in PT
    ERROR GET /etc/segmentation.segment.js HTTP/1.1] libs.cq.personalization.components.segmentpage.segment$js$jsp error while building a segment /etc/segmentation/intranet/California/jcr:content/traits org.apache.sling.api.scripting.ScriptEvaluationException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Error while executing script ../trait.js.jsp
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:385)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 56)
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:491)
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:45)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:182 )
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:149)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:219)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProce ssorImpl.java:280)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProces sorImpl.java:320)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatch er.java:208)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatche r.java:102)
    at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponent Filter.java:381)
    at org.apache.jsp.libs.cq.personalization.components.segmentpage.segment_js_jsp._jspService( segment_js_jsp.java:188)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:419)
    at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :173)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:84)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 56)
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:491)
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:45)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)
    8293,2-9 89%
    Caused by: java.lang.NullPointerException
    at com.day.cq.wcm.api.WCMMode.toRequest(WCMMode.java:71)
    at org.apache.jsp.libs.cq.personalization.components.traits.logic.trait_js_jsp._jspService(t rait_js_jsp.java:204)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:419)

  • Org.apache.struts.validator.Resources class not found

    hai all
    am wanted to create my own Validator for checking 2 password i usiing the code given in the url
    http://jakarta.apache.org/struts/userGuide/dev_validator.html
    "Pluggable Validators"
    i copyed the code
    public static boolean validateTwoFields(
        Object bean,
        ValidatorAction va,
        Field field,
        ActionErrors errors,
        HttpServletRequest request,
        ServletContext application) {
        String value = ValidatorUtils.getValueAsString(
            bean,
            field.getProperty());
        String sProperty2 = field.getVarValue("secondProperty");
        String value2 = ValidatorUtils.getValueAsString(
            bean,
            sProperty2);
        if (!GenericValidator.isBlankOrNull(value)) {
           try {
              if (!value.equals(value2)) {
                 errors.add(field.getKey(),
                    Resources.getActionError(
                        application,
                        request,
                        va,
                        field));
                 return false;
           } catch (Exception e) {
                 errors.add(field.getKey(),
                    Resources.getActionError(
                        application,
                        request,
                        va,
                        field));
                 return false;
        return true;
    }when i compile i got error
    The import org.apache.struts.validator.Resources cannot be resolved
    am using Struts 1.1 in Eclipse 3.0 tomcat 5
    anybody help me

    Please anybody help me

  • In iPhoto, can I remove selected batches of photos from my iPhone?

    In iPhoto, can I remove selected batches of photos from my iPhone 4S?

    Only if they are in the Photo Stream.  Pictures in the Camera Roll have to be deleted from the iPhone.
    OT

  • Hr report category remove selection fields..

    hi again All,
    I am facing a problem again. I tried generating a new category for my report. Now again after creating the category i do not see how to add fields and remove selection fields. I need only company code in my selection criteria and nothing else.
    can neone help me?
    suresh and sarika, i m expecting lot of you..
    please help..
    Reena..

    Reena,
    Pl follow these steps..
    1.In the Program Attributes, click on the pushbutton 'HR Report Category'.Click on the 'Create' icon in the pop-up window that comes up.
    2. On the next screen click on the 'New entries ' pushbutton in the menu bar.
    3. In the next screen enter a anme for the report Category, say, 0COMPCODE.
    4.On the same screen, you have a Navigation tree to the left hand side, click on the Allowable selection Criteria Node
    5. On the next screen, click on the New Entriees pushbutton
    6. On the next screen enter 'PNPBUKRS'.
    7. You will be prompted to tie it to a Transaport Request. Attach it to the sam ereq that your Report is tied to.
    8. SAVE it & attach it to your Program.
    ~Suresh

  • Remove selected from checkedlistbox?!

    I want remove selected items from checklistbox
    i used
     checkedListBox1.Items.Remove(checkedListBox1.SelectedItems);
    this not work well

    If you do the checking in the checkedListBox1_ItemCheck method:
    for (int i = 0; i < checkedListBox1.Items.Count; i++)
    if (i != e.Index)
    checkedListBox1.SetItemChecked(i, false);
    else if you want to check/uncheck the ticks in some other metohd, like on a button press:
    for (int i = 0; i < checkedListBox1.Items.Count; i++)
    if(checkedListBox1.item[i].checked)
    checkedListBox1.item[i].checked = false;
    else
    checkedListBox1.item[i].checked = true;
    Some additional info:
    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/89e37fe3-ca78-4057-bf28-575bcec22f30
    http://www.eggheadcafe.com/community/aspnet/2/10043218/c--change-item-check-state-to-item-in-checkedlistbox.aspx

  • Regd:org.apache.sling.api.scripting.ScriptEvaluationException: javax.servlet.ServletException

    Hi ,
    I'm getting the below exception while accessing the pages. It was working fine earlier..
    Any help on this please....???
    Caused by: org.apache.sling.api.SlingException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Error while executing script /libs/wcm/core/components/init/init.jsp
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInterna l(JspServletWrapper.java:563)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:499)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:443)
    at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :233)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:85)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:453)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)
    ... 93 more
    Caused by: org.apache.sling.api.SlingException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/day/cq/wcm/api/WCMMode
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInterna l(JspServletWrapper.java:563)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:499)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:443)
    at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :233)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:85)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:453)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 56)
    at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:167)
    at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:87)
    at org.apache.jsp.apps.bt_com.components.wrapperpage.wrapperpage_jsp._jspx_meth_cq_005finclu de_005f0(wrapperpage_jsp.java:430)
    at org.apache.jsp.apps.bt_com.components.wrapperpage.wrapperpage_jsp._jspService(wrapperpage _jsp.java:238)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:420)
    ... 98 more
    Caused by: java.lang.NoClassDefFoundError: com/day/cq/wcm/api/WCMMode
    at org.apache.jsp.libs.wcm.core.components.init.init_jsp._jspService(init_jsp.java:152)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJs
    Thanks,
    Shankar .A

    Hi Shankar,
    Try to open Apache Felix Console -> Bundles tab:
    http://localhost:4502/system/console/bundles
    and find:
    -> Apache Sling Scripting JSP support -> try to stop this bundle and start it again
    -> Apache Sling Dynamic Class Loader Support-> try to stop this bundle and start it again
    Restarting both bundles should solve your problem.
    Regards,
    kasq

  • Getting error in POI like ""The import org.apache.poi cannot be resolved""

    Hi
    i am getting error like this."""The import org.apache.poi cannot be resolved"" so what i need do here. i think i have to get the jars for it .any one who worked with the concept of poi can help me here. i have been using eclipse ide here.i have down loded pio.3.0-final ,then i have added jar files to eclipse. still i am getting this error here

    HI
    i have checked that in build path it is saying it is there os it can't add them,here i have taken as a class proj not as web proj.
    i have started this topic today only.so idon't know much abt this.i have got this code from poi downloads.here is the code for
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import java.io.FileInputStream;
    * This is a sample to Read an Excel Sheet using
    * Jakarta POI API
    * @author Elango Sundaram
    * @version 1.0
    public class ReadXl {
    /** Location where the Excel has to be read from. Note the forward Slash */
    public static String fileToBeRead="D:/JTest/JPOI/Read.xls";
    public static void main(String argv[]){      
    try{
                        // Create a work book reference
                        HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileToBeRead));
                        // Refer to the sheet. Put the Name of the sheet to be referred from
                        // Alternative you can also refer the sheet by index using getSheetAt(int index)
                        HSSFSheet sheet = workbook.getSheet("Sheet1");
                        //Reading the TOP LEFT CELL
                        HSSFRow row = sheet.getRow(0);
                        // Create a cell ate index zero ( Top Left)
                        HSSFCell cell = row.getCell((short)0);
                        // Type the content
                        System.out.println("THE TOP LEFT CELL--> " + cell.getStringCellValue());
    }catch(Exception e) {
    System.out.println("!! Bang !! xlRead() : " + e );
    }

  • How do I remove selected photos in the Photo Stream library.

    How do I remove selected photos in the Photo Stream library in Aperture 3?

    Just found this post in the iCloud Forum:
    Re: Delete single photos in photostream
    Apple is adding the ability to delete individual photos from the photostream in iOS 5.1 beta 2
    http://www.appleinsider.com/articles/11/12/12/apple_adds_ability_to_delete_indiv idual_photo_stream_pics_in_ios_5_1_beta_2.html
    Hope it's true ...

  • How can I remove selected sections? [js][CC2014]

    Hello,
    I'm trying to remove selected sections from my document.
    I figured out how to remove them by index number like this:
    var myDoc = app.activeDocument;
    var mySections = myDoc.sections;
    mySections[1].remove();
    When I try to limit the removal of sections to just my selection, I keep getting errors. I've tried:
    var myDoc = app.activeDocument;
    var mySections = myDoc.sections;
    var mySelection = myDoc.selection;
    mySelection.sections[1].remove();
    And:
    var myDoc = app.activeDocument;
    var mySections = myDoc.sections;
    var mySelection = myDoc.selection;
    mySelection[0].sections[1].remove();
    But I keep getting Error 21 undefined is not an object on line 5.
    Any help is much appreciated.

    I'm trying to remove the section not the content. It would be the equivalent of selecting the first page of a section in the page panel, then right-clicking on it and clicking on "Numbering and sections..." and then unchecking the "Start Section" checkbox.
    That's what the first code snippet does. But I was only able to do it by index number.
    I've read in other posts that it's difficult to specify selections in the page panel using scripting. I'm not sure if it's even possible.

  • Error package upload - com.day.jcr.vault.fs.config.ConfigurationException: Filter pattern

    I am uploading a content packaged created in one environment to QA environment. I see this error everytime. The package upload status bar moves till 100%, see some more updates but at the end pops  up this exception - com.day.jcr.vault.fs.config.ConfigurationException: Filter pattern must not be empty.
    I could not make much out of it or successfully install the packages.
    Has anyone seen similar error?
    Thanks

    I guess problem is you have one empty filter in to your filter discription. Remove that build your package and try to install it again.
    Let us know if that works
    Yogesh
    www.wemblog.com

  • Delete PSA Selection Patterns Not Visible

    Hi All,
    I am using BI 7 process chains to schedule a delete PSA job. I am using the delete PSA variant. The issue that I am facing is that in one of the documents that I came across on the net - it shows a screen where I can specify selection patterns with the delete PSA variant. My current variant does not display this information. It displays the following -
    Object | Object Type | Object Name |
    The document that I found has the following information
    DataSource | Src System | Older than
    The link to the document -
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a02ba9e7-bb6f-2c10-09b4-e86b9fcbad41]
    So basically I am little confused as to where this functionality resides. Any clues any one?
    Rahul

    Hi,
    you need EhP1 for this functionality.
    Best regards,
    Ralf

  • Accidentally removed Design Pattern

    I created a new paltform independent UML project in SJSE8. Made a class diagram and did a drag and drop of the Factory Method from the GOF:Creational. I started modifying it and saw that it was modifying the pattern in the design center. Well I then deleted the objects from the class diagram. That removed the pattern from the design center. Any ideas on how to recover the pattern? I tried an update but that did not work.
    Thanks for any help.

    Can u try running the ide with a different user directory and see if the pattern comes back?
    http://blogs.sun.com/roller/page/karthikr?entry=jse_directories

Maybe you are looking for