Forums de discussion

get_articles working with localhost but not working with ip even 127.0.0.1

Al-Mothafar Al-Hasan, modifié il y a 11 années.

get_articles working with localhost but not working with ip even 127.0.0.1

Regular Member Publications: 110 Date d'inscription: 06/12/09 Publications récentes
Hi

Simply I have a strange issue that I can't understand it, I'm trying to get articles to get content using sax reader, I have the following code :

    #set ($document = $saxReaderUtil.readURL("http://localhost:8080/c/journal/get_articles?structureId=NEWS_STR&templateId=NEWS_STR&delta=5&type=general&languageId=en"))

    #set ($root = $document.getRootElement())
    #set ($articles = $root.selectNodes("/result-set/result/root"))

    #foreach ($article IN $articles)
        #set ($newsText = $article.selectSingleNode("dynamic-element[@name='Title']/dynamic-content"))
        $newsText.getData()
    #end


The problem I cant see any thing from content !! even with ip or local host, after I tried to troubleshoot I found something, I see that when I type the following address in browser, that I got xml :

http://localhost:8080/c/journal/get_articles?structureId=NEWS_STR&templateId=NEWS_STR&delta=5&type=general&languageId=en


But with IP not working !! even localhost (127.0.0.1) ip, or my PC IP like :

http://127.0.0.1:8080/c/journal/get_articles?structureId=NEWS_STR&templateId=NEWS_STR&delta=5&type=general&languageId=en


I can't understand why?

I'm using Liferay 6.1 bundled with Tomcat 7.0.23

Edit: Just note, I tested same code in 6.0.6 and working !

Thanks
thumbnail
Hitoshi Ozawa, modifié il y a 11 années.

RE: get_articles working with localhost but not working with ip even 127.0.

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
There are some properties in portal-ext.properties to limit server access. Have you checked any of them?
Al-Mothafar Al-Hasan, modifié il y a 11 années.

RE: get_articles working with localhost but not working with ip even 127.0.

Regular Member Publications: 110 Date d'inscription: 06/12/09 Publications récentes
Hitoshi Ozawa:
There are some properties in portal-ext.properties to limit server access. Have you checked any of them?


All still in default.
Al-Mothafar Al-Hasan, modifié il y a 11 années.

RE: get_articles working with localhost but not working with ip even 127.0.

Regular Member Publications: 110 Date d'inscription: 06/12/09 Publications récentes
Its working in Liferay 6.0.6 , only in 6.1.0 not working, seems saxReader not working !?
Wafa Bouyahi, modifié il y a 9 années.

RE: get_articles working with localhost but not working with ip even 127.0.

New Member Publications: 5 Date d'inscription: 03/05/13 Publications récentes
Did you find any solution please? I'm stuck in the same problem emoticon $articles.size() is always 0